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

See gh-47263
This commit is contained in:
Moritz Halbritter
2025-10-16 11:24:45 +02:00
parent 69cc9f8dea
commit e2c1c3727d
2 changed files with 8 additions and 1 deletions
@@ -29,3 +29,7 @@ dependencies {
testImplementation(project(":starter:spring-boot-starter-test"))
}
tasks.named("compileTestJava") {
options.nullability.checking = "tests"
}
@@ -69,7 +69,10 @@ class SampleLiquibaseApplicationTests {
};
if (nested.contains(ConnectException.class)) {
Throwable root = nested.getRootCause();
return root.getMessage().contains("Connection refused");
assertThat(root).isNotNull();
String message = root.getMessage();
assertThat(message).isNotNull();
return message.contains("Connection refused");
}
return false;
}