From c9417eb2771cd77df93d5744001f7d4a6645af2c Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Thu, 16 Oct 2025 09:55:07 +0200 Subject: [PATCH] Add nullability annotations to tests in smoke-test/spring-boot-smoke-test-web-groovy-templates See gh-47263 --- .../spring-boot-smoke-test-web-groovy-templates/build.gradle | 4 ++++ .../groovytemplates/SampleGroovyTemplateApplicationTests.java | 1 + 2 files changed, 5 insertions(+) diff --git a/smoke-test/spring-boot-smoke-test-web-groovy-templates/build.gradle b/smoke-test/spring-boot-smoke-test-web-groovy-templates/build.gradle index 539b4e1e1cc..41be35747e9 100644 --- a/smoke-test/spring-boot-smoke-test-web-groovy-templates/build.gradle +++ b/smoke-test/spring-boot-smoke-test-web-groovy-templates/build.gradle @@ -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" +} diff --git a/smoke-test/spring-boot-smoke-test-web-groovy-templates/src/test/java/smoketest/groovytemplates/SampleGroovyTemplateApplicationTests.java b/smoke-test/spring-boot-smoke-test-web-groovy-templates/src/test/java/smoketest/groovytemplates/SampleGroovyTemplateApplicationTests.java index 2f3738f5732..8e96b6a433a 100644 --- a/smoke-test/spring-boot-smoke-test-web-groovy-templates/src/test/java/smoketest/groovytemplates/SampleGroovyTemplateApplicationTests.java +++ b/smoke-test/spring-boot-smoke-test-web-groovy-templates/src/test/java/smoketest/groovytemplates/SampleGroovyTemplateApplicationTests.java @@ -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); }