diff --git a/smoke-test/spring-boot-smoke-test-tomcat/build.gradle b/smoke-test/spring-boot-smoke-test-tomcat/build.gradle index f8d7ac4d22e..fc6c7957000 100644 --- a/smoke-test/spring-boot-smoke-test-tomcat/build.gradle +++ b/smoke-test/spring-boot-smoke-test-tomcat/build.gradle @@ -26,3 +26,7 @@ dependencies { testImplementation(project(":module:spring-boot-resttestclient")) testImplementation(project(":starter:spring-boot-starter-test")) } + +tasks.named("compileTestJava") { + options.nullability.checking = "tests" +} diff --git a/smoke-test/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/SampleTomcatApplicationTests.java b/smoke-test/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/SampleTomcatApplicationTests.java index da16800075a..a3ea2a1947d 100644 --- a/smoke-test/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/SampleTomcatApplicationTests.java +++ b/smoke-test/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/SampleTomcatApplicationTests.java @@ -98,6 +98,7 @@ class SampleTomcatApplicationTests { void testTimeout() { ServletWebServerApplicationContext context = (ServletWebServerApplicationContext) this.applicationContext; TomcatWebServer embeddedServletContainer = (TomcatWebServer) context.getWebServer(); + assertThat(embeddedServletContainer).isNotNull(); ProtocolHandler protocolHandler = embeddedServletContainer.getTomcat().getConnector().getProtocolHandler(); int timeout = ((AbstractProtocol) protocolHandler).getConnectionTimeout(); assertThat(timeout).isEqualTo(5000);