Browse Source

Add nullability annotations to tests in module/spring-boot-reactor

See gh-47263
pull/47626/head
Moritz Halbritter 2 months ago
parent
commit
3466271f35
  1. 6
      module/spring-boot-reactor/build.gradle
  2. 3
      module/spring-boot-reactor/src/test/java/org/springframework/boot/reactor/ReactorEnvironmentPostProcessorTests.java

6
module/spring-boot-reactor/build.gradle

@ -34,5 +34,11 @@ dependencies {
testImplementation(project(":test-support:spring-boot-test-support")) testImplementation(project(":test-support:spring-boot-test-support"))
testImplementation("io.micrometer:context-propagation") testImplementation("io.micrometer:context-propagation")
testCompileOnly("com.google.code.findbugs:jsr305")
testRuntimeOnly("ch.qos.logback:logback-classic") testRuntimeOnly("ch.qos.logback:logback-classic")
} }
tasks.named("compileTestJava") {
options.nullability.checking = "tests"
}

3
module/spring-boot-reactor/src/test/java/org/springframework/boot/reactor/ReactorEnvironmentPostProcessorTests.java

@ -24,6 +24,7 @@ import org.junit.jupiter.api.condition.JRE;
import reactor.core.Scannable; import reactor.core.Scannable;
import reactor.core.publisher.Flux; import reactor.core.publisher.Flux;
import org.springframework.boot.SpringApplication;
import org.springframework.mock.env.MockEnvironment; import org.springframework.mock.env.MockEnvironment;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
@ -41,7 +42,7 @@ class ReactorEnvironmentPostProcessorTests {
MockEnvironment environment = new MockEnvironment(); MockEnvironment environment = new MockEnvironment();
environment.setProperty("spring.threads.virtual.enabled", "true"); environment.setProperty("spring.threads.virtual.enabled", "true");
ReactorEnvironmentPostProcessor postProcessor = new ReactorEnvironmentPostProcessor(); ReactorEnvironmentPostProcessor postProcessor = new ReactorEnvironmentPostProcessor();
postProcessor.postProcessEnvironment(environment, null); postProcessor.postProcessEnvironment(environment, new SpringApplication());
} }
@Test @Test

Loading…
Cancel
Save