Browse Source

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

See gh-47263
pull/47665/head
Moritz Halbritter 2 months ago
parent
commit
2d780f4e00
  1. 4
      smoke-test/spring-boot-smoke-test-war/build.gradle
  2. 3
      smoke-test/spring-boot-smoke-test-war/src/test/java/smoketest/war/WarApplicationResourceTests.java

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

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

3
smoke-test/spring-boot-smoke-test-war/src/test/java/smoketest/war/WarApplicationResourceTests.java

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
package smoketest.war;
import org.jspecify.annotations.Nullable;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Value;
@ -29,7 +30,7 @@ class WarApplicationResourceTests { @@ -29,7 +30,7 @@ class WarApplicationResourceTests {
// gh-6371
@Value("${demo.string.value}")
private String demoStringValue;
private @Nullable String demoStringValue;
@Test
void contextLoads() {

Loading…
Cancel
Save