Skip to content

Commit a350ead

Browse files
committed
Add nullability annotations to tests in module/spring-boot-data-redis-test
See gh-47263
1 parent 55a97aa commit a350ead

File tree

2 files changed

+16
-6
lines changed
  • module/spring-boot-data-redis-test

2 files changed

+16
-6
lines changed

module/spring-boot-data-redis-test/build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,11 @@ dependencies {
4848

4949
testRuntimeOnly("ch.qos.logback:logback-classic")
5050
}
51+
52+
tasks.named("compileTestJava") {
53+
options.nullability.checking = "tests"
54+
}
55+
56+
tasks.named("compileDockerTestJava") {
57+
options.nullability.checking = "tests"
58+
}

module/spring-boot-data-redis-test/src/dockerTest/java/org/springframework/boot/data/redis/test/autoconfigure/PersonHash.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package org.springframework.boot.data.redis.test.autoconfigure;
1818

19+
import org.jspecify.annotations.Nullable;
20+
1921
import org.springframework.data.annotation.Id;
2022
import org.springframework.data.redis.core.RedisHash;
2123

@@ -28,23 +30,23 @@
2830
public class PersonHash {
2931

3032
@Id
31-
private String id;
33+
private @Nullable String id;
3234

33-
private String description;
35+
private @Nullable String description;
3436

35-
public String getId() {
37+
public @Nullable String getId() {
3638
return this.id;
3739
}
3840

39-
public void setId(String id) {
41+
public void setId(@Nullable String id) {
4042
this.id = id;
4143
}
4244

43-
public String getDescription() {
45+
public @Nullable String getDescription() {
4446
return this.description;
4547
}
4648

47-
public void setDescription(String description) {
49+
public void setDescription(@Nullable String description) {
4850
this.description = description;
4951
}
5052

0 commit comments

Comments
 (0)