Browse Source

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

See gh-47263
pull/47626/head
Moritz Halbritter 2 months ago
parent
commit
118bf10127
  1. 4
      module/spring-boot-rsocket-test/build.gradle
  2. 5
      module/spring-boot-rsocket-test/src/test/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPortTests.java

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

@ -33,3 +33,7 @@ dependencies {
testRuntimeOnly("ch.qos.logback:logback-classic") testRuntimeOnly("ch.qos.logback:logback-classic")
} }
tasks.named("compileTestJava") {
options.nullability.checking = "tests"
}

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

@ -16,6 +16,7 @@
package org.springframework.boot.test.rsocket.server; package org.springframework.boot.test.rsocket.server;
import org.jspecify.annotations.Nullable;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
@ -37,10 +38,10 @@ import static org.assertj.core.api.Assertions.assertThat;
class LocalRSocketServerPortTests { class LocalRSocketServerPortTests {
@Value("${local.rsocket.server.port}") @Value("${local.rsocket.server.port}")
private String fromValue; private @Nullable String fromValue;
@LocalRSocketServerPort @LocalRSocketServerPort
private String fromAnnotation; private @Nullable String fromAnnotation;
@Test @Test
void testLocalRSocketServerPortAnnotation() { void testLocalRSocketServerPortAnnotation() {

Loading…
Cancel
Save