diff --git a/module/spring-boot-security-test/build.gradle b/module/spring-boot-security-test/build.gradle index 51f12b8b147..9932ee80b32 100644 --- a/module/spring-boot-security-test/build.gradle +++ b/module/spring-boot-security-test/build.gradle @@ -40,3 +40,7 @@ dependencies { testRuntimeOnly("ch.qos.logback:logback-classic") } + +tasks.named("compileTestJava") { + options.nullability.checking = "tests" +} diff --git a/module/spring-boot-security-test/src/test/java/org/springframework/boot/security/test/autoconfigure/webflux/WebTestClientSecurityIntegrationTests.java b/module/spring-boot-security-test/src/test/java/org/springframework/boot/security/test/autoconfigure/webflux/WebTestClientSecurityIntegrationTests.java index c470714c97d..708c6f216a4 100644 --- a/module/spring-boot-security-test/src/test/java/org/springframework/boot/security/test/autoconfigure/webflux/WebTestClientSecurityIntegrationTests.java +++ b/module/spring-boot-security-test/src/test/java/org/springframework/boot/security/test/autoconfigure/webflux/WebTestClientSecurityIntegrationTests.java @@ -51,9 +51,12 @@ class WebTestClientSecurityIntegrationTests { WebTestClient webTestClient = context.getBean(WebTestClient.class); WebTestClient.Builder builder = (WebTestClient.Builder) ReflectionTestUtils.getField(webTestClient, "builder"); + assertThat(builder).isNotNull(); WebHttpHandlerBuilder httpHandlerBuilder = (WebHttpHandlerBuilder) ReflectionTestUtils.getField(builder, "httpHandlerBuilder"); + assertThat(httpHandlerBuilder).isNotNull(); List filters = (List) ReflectionTestUtils.getField(httpHandlerBuilder, "filters"); + assertThat(filters).isNotNull(); assertThat(filters.get(0).getClass().getName()).isEqualTo( "org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers$MutatorFilter"); });