Browse Source

Add nullability annotations to tests in module/spring-boot-hazelcast

See gh-47263
pull/47415/head
Moritz Halbritter 3 months ago
parent
commit
0634c11eee
  1. 8
      module/spring-boot-hazelcast/build.gradle
  2. 3
      module/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfigurationServerTests.java

8
module/spring-boot-hazelcast/build.gradle

@ -54,3 +54,11 @@ dependencies { @@ -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"
}

3
module/spring-boot-hazelcast/src/test/java/org/springframework/boot/hazelcast/autoconfigure/HazelcastAutoConfigurationServerTests.java

@ -31,6 +31,7 @@ import com.hazelcast.map.EntryProcessor; @@ -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 { @@ -319,7 +320,7 @@ class HazelcastAutoConfigurationServerTests {
private Environment environment;
@Override
public String process(Map.Entry<String, V> entry) {
public @Nullable String process(Map.Entry<String, V> entry) {
return this.environment.getProperty(entry.getKey());
}

Loading…
Cancel
Save