Browse Source

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

See gh-47263
pull/47665/head
Moritz Halbritter 2 months ago
parent
commit
bdec5c14bb
  1. 4
      smoke-test/spring-boot-smoke-test-tomcat/build.gradle
  2. 1
      smoke-test/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/SampleTomcatApplicationTests.java

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

@ -26,3 +26,7 @@ dependencies { @@ -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"
}

1
smoke-test/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/SampleTomcatApplicationTests.java

@ -98,6 +98,7 @@ class SampleTomcatApplicationTests { @@ -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);

Loading…
Cancel
Save