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

See gh-47263
This commit is contained in:
Moritz Halbritter
2025-10-16 11:24:49 +02:00
parent c7ffb8adb8
commit 60da903596
2 changed files with 8 additions and 1 deletions
@@ -27,3 +27,7 @@ dependencies {
testImplementation(project(":starter:spring-boot-starter-webmvc-test"))
testImplementation("org.apache.httpcomponents.client5:httpclient5")
}
tasks.named("compileTestJava") {
options.nullability.checking = "tests"
}
@@ -30,6 +30,7 @@ import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.boot.tomcat.TomcatWebServer;
import org.springframework.boot.web.server.AbstractConfigurableWebServerFactory;
import org.springframework.boot.web.server.Ssl;
import org.springframework.boot.web.server.context.WebServerInitializedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Import;
@@ -63,7 +64,9 @@ class SampleTomcatTwoConnectorsApplicationTests {
@Test
void testSsl() {
assertThat(this.webServerFactory.getSsl().isEnabled()).isTrue();
Ssl ssl = this.webServerFactory.getSsl();
assertThat(ssl).isNotNull();
assertThat(ssl.isEnabled()).isTrue();
}
@Test