diff --git a/module/spring-boot-webclient/build.gradle b/module/spring-boot-webclient/build.gradle index e4afeccf3af..8f7305a5ee0 100644 --- a/module/spring-boot-webclient/build.gradle +++ b/module/spring-boot-webclient/build.gradle @@ -44,3 +44,7 @@ dependencies { testRuntimeOnly("ch.qos.logback:logback-classic") } + +tasks.named("compileTestJava") { + options.nullability.checking = "tests" +} diff --git a/module/spring-boot-webclient/src/test/java/org/springframework/boot/webclient/autoconfigure/service/ReactiveHttpServiceClientAutoConfigurationTests.java b/module/spring-boot-webclient/src/test/java/org/springframework/boot/webclient/autoconfigure/service/ReactiveHttpServiceClientAutoConfigurationTests.java index 6bc77b8eb36..527d0bc66aa 100644 --- a/module/spring-boot-webclient/src/test/java/org/springframework/boot/webclient/autoconfigure/service/ReactiveHttpServiceClientAutoConfigurationTests.java +++ b/module/spring-boot-webclient/src/test/java/org/springframework/boot/webclient/autoconfigure/service/ReactiveHttpServiceClientAutoConfigurationTests.java @@ -126,6 +126,7 @@ class ReactiveHttpServiceClientAutoConfigurationTests { then(builder).should().clientConnector(connectorCaptor.capture()); ClientHttpConnector client = connectorCaptor.getValue(); HttpClient httpClient = (HttpClient) ReflectionTestUtils.getField(client, "httpClient"); + assertThat(httpClient).isNotNull(); assertThat(httpClient.connectTimeout()).contains(expectedReadTimeout); }