Add nullability annotations to tests in module/spring-boot-data-ldap-test

See gh-47263
This commit is contained in:
Moritz Halbritter 2025-10-06 11:52:53 +02:00
parent 2edd8f9d62
commit 99f8c4cd0d
2 changed files with 13 additions and 3 deletions

View File

@ -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"
}

View File

@ -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;
}