diff --git a/module/spring-boot-hazelcast/build.gradle b/module/spring-boot-hazelcast/build.gradle index 9055a423f30..2b6087c120d 100644 --- a/module/spring-boot-hazelcast/build.gradle +++ b/module/spring-boot-hazelcast/build.gradle @@ -54,3 +54,11 @@ dependencies { testRuntimeOnly("com.h2database:h2") testRuntimeOnly("ch.qos.logback:logback-classic") } + +tasks.named("compileTestJava") { + options.nullability.checking = "tests" +} + +tasks.named("compileDockerTestJava") { + options.nullability.checking = "tests" +} diff --git a/module/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfigurationServerTests.java b/module/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfigurationServerTests.java index baf7d8fc817..b223058c1ff 100644 --- a/module/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfigurationServerTests.java +++ b/module/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfigurationServerTests.java @@ -31,6 +31,7 @@ import com.hazelcast.map.EntryProcessor; import com.hazelcast.map.IMap; import com.hazelcast.spring.context.SpringAware; import com.hazelcast.spring.context.SpringManagedContext; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -319,7 +320,7 @@ class HazelcastAutoConfigurationServerTests { private Environment environment; @Override - public String process(Map.Entry entry) { + public @Nullable String process(Map.Entry entry) { return this.environment.getProperty(entry.getKey()); }