diff --git a/module/spring-boot-thymeleaf/build.gradle b/module/spring-boot-thymeleaf/build.gradle index 21089b4f32b..27621837df7 100644 --- a/module/spring-boot-thymeleaf/build.gradle +++ b/module/spring-boot-thymeleaf/build.gradle @@ -49,3 +49,7 @@ dependencies { testRuntimeOnly("ch.qos.logback:logback-classic") } + +tasks.named("compileTestJava") { + options.nullability.checking = "tests" +} diff --git a/module/spring-boot-thymeleaf/src/test/java/org/springframework/boot/thymeleaf/autoconfigure/ThymeleafServletAutoConfigurationTests.java b/module/spring-boot-thymeleaf/src/test/java/org/springframework/boot/thymeleaf/autoconfigure/ThymeleafServletAutoConfigurationTests.java index 7652afef788..f5f508b204e 100644 --- a/module/spring-boot-thymeleaf/src/test/java/org/springframework/boot/thymeleaf/autoconfigure/ThymeleafServletAutoConfigurationTests.java +++ b/module/spring-boot-thymeleaf/src/test/java/org/springframework/boot/thymeleaf/autoconfigure/ThymeleafServletAutoConfigurationTests.java @@ -206,6 +206,7 @@ class ThymeleafServletAutoConfigurationTests { this.contextRunner.run((context) -> { ThymeleafView view = (ThymeleafView) context.getBean(ThymeleafViewResolver.class) .resolveViewName("view", Locale.UK); + assertThat(view).isNotNull(); MockHttpServletResponse response = new MockHttpServletResponse(); MockHttpServletRequest request = new MockHttpServletRequest(context.getBean(ServletContext.class)); request.setAttribute(RequestContext.WEB_APPLICATION_CONTEXT_ATTRIBUTE, context);