Browse Source

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

See gh-47263
pull/47415/head
Moritz Halbritter 2 months ago
parent
commit
99f8c4cd0d
  1. 8
      module/spring-boot-data-ldap-test/build.gradle
  2. 8
      module/spring-boot-data-ldap-test/src/test/java/org/springframework/boot/data/ldap/test/autoconfigure/ExampleEntry.java

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

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

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

Loading…
Cancel
Save