diff --git a/module/spring-boot-data-ldap-test/build.gradle b/module/spring-boot-data-ldap-test/build.gradle index 48b086a5255..b4dedcceca7 100644 --- a/module/spring-boot-data-ldap-test/build.gradle +++ b/module/spring-boot-data-ldap-test/build.gradle @@ -44,3 +44,11 @@ dependencies { 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-data-ldap-test/src/test/java/org/springframework/boot/data/ldap/test/autoconfigure/ExampleEntry.java b/module/spring-boot-data-ldap-test/src/test/java/org/springframework/boot/data/ldap/test/autoconfigure/ExampleEntry.java index a59ff35ef90..ee7643a9de3 100644 --- a/module/spring-boot-data-ldap-test/src/test/java/org/springframework/boot/data/ldap/test/autoconfigure/ExampleEntry.java +++ b/module/spring-boot-data-ldap-test/src/test/java/org/springframework/boot/data/ldap/test/autoconfigure/ExampleEntry.java @@ -18,6 +18,8 @@ package org.springframework.boot.data.ldap.test.autoconfigure; import javax.naming.Name; +import org.jspecify.annotations.Nullable; + import org.springframework.ldap.odm.annotations.Entry; import org.springframework.ldap.odm.annotations.Id; @@ -30,13 +32,13 @@ import org.springframework.ldap.odm.annotations.Id; public class ExampleEntry { @Id - private Name dn; + private @Nullable Name dn; - public Name getDn() { + public @Nullable Name getDn() { return this.dn; } - public void setDn(Name dn) { + public void setDn(@Nullable Name dn) { this.dn = dn; }