Add nullability annotations to tests in module/spring-boot-webflux-test

See gh-47263
This commit is contained in:
Moritz Halbritter
2025-10-15 16:58:21 +02:00
parent 8236fa2f42
commit 6db7fa6d46
3 changed files with 8 additions and 2 deletions
@@ -39,3 +39,7 @@ dependencies {
testRuntimeOnly("ch.qos.logback:logback-classic")
}
tasks.named("compileTestJava") {
options.nullability.checking = "tests"
}
@@ -20,6 +20,8 @@ import java.util.Collections;
import java.util.Set;
import java.util.UUID;
import org.jspecify.annotations.Nullable;
import org.springframework.core.convert.TypeDescriptor;
import org.springframework.core.convert.converter.GenericConverter;
import org.springframework.stereotype.Component;
@@ -38,7 +40,7 @@ public class ExampleIdConverter implements GenericConverter {
}
@Override
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
public @Nullable Object convert(@Nullable Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
if (source == null) {
return null;
}
@@ -176,7 +176,7 @@ class WebFluxTypeExcludeFilterTests {
@Override
public Mono<Void> filter(ServerWebExchange serverWebExchange, WebFilterChain webFilterChain) {
return null;
return Mono.empty();
}
}