Add nullability annotations to tests in smoke-test/spring-boot-smoke-test-tomcat

See gh-47263
This commit is contained in:
Moritz Halbritter
2025-10-16 11:24:48 +02:00
parent 43308f017a
commit bdec5c14bb
2 changed files with 5 additions and 0 deletions
@@ -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"
}
@@ -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);