From a97975df2592a67ac7a5ea5a5e35fe7f989eede7 Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Wed, 15 Oct 2025 15:21:15 +0200 Subject: [PATCH] Add nullability annotations to tests in module/spring-boot-webclient See gh-47263 --- module/spring-boot-webclient/build.gradle | 4 ++++ .../ReactiveHttpServiceClientAutoConfigurationTests.java | 1 + 2 files changed, 5 insertions(+) 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); }