Skip to content

Commit 99f8c4c

Browse files
committed
Add nullability annotations to tests in module/spring-boot-data-ldap-test
See gh-47263
1 parent 2edd8f9 commit 99f8c4c

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

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

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

4545
testRuntimeOnly("ch.qos.logback:logback-classic")
4646
}
47+
48+
tasks.named("compileTestJava") {
49+
options.nullability.checking = "tests"
50+
}
51+
52+
tasks.named("compileDockerTestJava") {
53+
options.nullability.checking = "tests"
54+
}

module/spring-boot-data-ldap-test/src/test/java/org/springframework/boot/data/ldap/test/autoconfigure/ExampleEntry.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
import javax.naming.Name;
2020

21+
import org.jspecify.annotations.Nullable;
22+
2123
import org.springframework.ldap.odm.annotations.Entry;
2224
import org.springframework.ldap.odm.annotations.Id;
2325

@@ -30,13 +32,13 @@
3032
public class ExampleEntry {
3133

3234
@Id
33-
private Name dn;
35+
private @Nullable Name dn;
3436

35-
public Name getDn() {
37+
public @Nullable Name getDn() {
3638
return this.dn;
3739
}
3840

39-
public void setDn(Name dn) {
41+
public void setDn(@Nullable Name dn) {
4042
this.dn = dn;
4143
}
4244

0 commit comments

Comments
 (0)