Browse Source

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

See gh-47263
pull/47665/head
Moritz Halbritter 2 months ago
parent
commit
e2c1c3727d
  1. 4
      smoke-test/spring-boot-smoke-test-liquibase/build.gradle
  2. 5
      smoke-test/spring-boot-smoke-test-liquibase/src/test/java/smoketest/liquibase/SampleLiquibaseApplicationTests.java

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

@ -29,3 +29,7 @@ dependencies { @@ -29,3 +29,7 @@ dependencies {
testImplementation(project(":starter:spring-boot-starter-test"))
}
tasks.named("compileTestJava") {
options.nullability.checking = "tests"
}

5
smoke-test/spring-boot-smoke-test-liquibase/src/test/java/smoketest/liquibase/SampleLiquibaseApplicationTests.java

@ -69,7 +69,10 @@ class SampleLiquibaseApplicationTests { @@ -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;
}

Loading…
Cancel
Save