Browse Source

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

See gh-47263
pull/47665/head
Moritz Halbritter 2 months ago
parent
commit
60da903596
  1. 4
      smoke-test/spring-boot-smoke-test-tomcat-multi-connectors/build.gradle
  2. 5
      smoke-test/spring-boot-smoke-test-tomcat-multi-connectors/src/test/java/smoketest/tomcat/multiconnector/SampleTomcatTwoConnectorsApplicationTests.java

4
smoke-test/spring-boot-smoke-test-tomcat-multi-connectors/build.gradle

@ -27,3 +27,7 @@ dependencies {
testImplementation(project(":starter:spring-boot-starter-webmvc-test")) testImplementation(project(":starter:spring-boot-starter-webmvc-test"))
testImplementation("org.apache.httpcomponents.client5:httpclient5") testImplementation("org.apache.httpcomponents.client5:httpclient5")
} }
tasks.named("compileTestJava") {
options.nullability.checking = "tests"
}

5
smoke-test/spring-boot-smoke-test-tomcat-multi-connectors/src/test/java/smoketest/tomcat/multiconnector/SampleTomcatTwoConnectorsApplicationTests.java

@ -30,6 +30,7 @@ import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.boot.tomcat.TomcatWebServer; import org.springframework.boot.tomcat.TomcatWebServer;
import org.springframework.boot.web.server.AbstractConfigurableWebServerFactory; 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.boot.web.server.context.WebServerInitializedEvent;
import org.springframework.context.ApplicationListener; import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
@ -63,7 +64,9 @@ class SampleTomcatTwoConnectorsApplicationTests {
@Test @Test
void testSsl() { void testSsl() {
assertThat(this.webServerFactory.getSsl().isEnabled()).isTrue(); Ssl ssl = this.webServerFactory.getSsl();
assertThat(ssl).isNotNull();
assertThat(ssl.isEnabled()).isTrue();
} }
@Test @Test

Loading…
Cancel
Save