Browse Source

Add nullability annotations to tests in smoke-test/spring-boot-smoke-test-web-groovy-templates

See gh-47263
pull/47665/head
Moritz Halbritter 2 months ago
parent
commit
c9417eb277
  1. 4
      smoke-test/spring-boot-smoke-test-web-groovy-templates/build.gradle
  2. 1
      smoke-test/spring-boot-smoke-test-web-groovy-templates/src/test/java/smoketest/groovytemplates/SampleGroovyTemplateApplicationTests.java

4
smoke-test/spring-boot-smoke-test-web-groovy-templates/build.gradle

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

1
smoke-test/spring-boot-smoke-test-web-groovy-templates/src/test/java/smoketest/groovytemplates/SampleGroovyTemplateApplicationTests.java

@ -62,6 +62,7 @@ class SampleGroovyTemplateApplicationTests { @@ -62,6 +62,7 @@ class SampleGroovyTemplateApplicationTests {
map.set("text", "FOO text");
map.set("summary", "FOO");
URI location = this.restTemplate.postForLocation("/", map);
assertThat(location).isNotNull();
assertThat(location.toString()).contains("localhost:" + this.port);
}

Loading…
Cancel
Save