Skip to content

Commit 118bf10

Browse files
committed
Add nullability annotations to tests in module/spring-boot-rsocket-test
See gh-47263
1 parent d0ae20f commit 118bf10

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

module/spring-boot-rsocket-test/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ dependencies {
3333

3434
testRuntimeOnly("ch.qos.logback:logback-classic")
3535
}
36+
37+
tasks.named("compileTestJava") {
38+
options.nullability.checking = "tests"
39+
}

module/spring-boot-rsocket-test/src/test/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPortTests.java

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

1717
package org.springframework.boot.test.rsocket.server;
1818

19+
import org.jspecify.annotations.Nullable;
1920
import org.junit.jupiter.api.Test;
2021
import org.junit.jupiter.api.extension.ExtendWith;
2122

@@ -37,10 +38,10 @@
3738
class LocalRSocketServerPortTests {
3839

3940
@Value("${local.rsocket.server.port}")
40-
private String fromValue;
41+
private @Nullable String fromValue;
4142

4243
@LocalRSocketServerPort
43-
private String fromAnnotation;
44+
private @Nullable String fromAnnotation;
4445

4546
@Test
4647
void testLocalRSocketServerPortAnnotation() {

0 commit comments

Comments
 (0)