Skip to content

Commit 09311ff

Browse files
committed
Add nullability annotations to tests in module/spring-boot-groovy-templates
See gh-47263
1 parent 9f1e033 commit 09311ff

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

module/spring-boot-groovy-templates/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,7 @@ dependencies {
4040

4141
testRuntimeOnly("ch.qos.logback:logback-classic")
4242
}
43+
44+
tasks.named("compileTestJava") {
45+
options.nullability.checking = "tests"
46+
}

module/spring-boot-groovy-templates/src/test/java/org/springframework/boot/groovy/template/autoconfigure/GroovyTemplateAutoConfigurationTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import groovy.text.markup.MarkupTemplateEngine;
3030
import groovy.text.markup.TemplateConfiguration;
3131
import jakarta.servlet.http.HttpServletRequest;
32+
import org.jspecify.annotations.Nullable;
3233
import org.junit.jupiter.api.AfterEach;
3334
import org.junit.jupiter.api.BeforeEach;
3435
import org.junit.jupiter.api.Test;
@@ -320,7 +321,7 @@ static class CustomBaseTemplate extends BaseTemplate {
320321
}
321322

322323
@Override
323-
public Object run() {
324+
public @Nullable Object run() {
324325
return null;
325326
}
326327

0 commit comments

Comments
 (0)