Browse Source

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

See gh-47263
pull/47387/head
Moritz Halbritter 4 months ago
parent
commit
f5d6bea934
  1. 10
      module/spring-boot-couchbase/build.gradle
  2. 2
      module/spring-boot-couchbase/src/test/java/org/springframework/boot/couchbase/health/CouchbaseReactiveHealthIndicatorTests.java

10
module/spring-boot-couchbase/build.gradle

@ -44,5 +44,15 @@ dependencies { @@ -44,5 +44,15 @@ dependencies {
testImplementation(project(":core:spring-boot-test"))
testImplementation(project(":test-support:spring-boot-test-support"))
testCompileOnly("com.google.code.findbugs:jsr305")
testRuntimeOnly("ch.qos.logback:logback-classic")
}
tasks.named("compileTestJava") {
options.nullability.checking = "tests"
}
tasks.named("compileDockerTestJava") {
options.nullability.checking = "tests"
}

2
module/spring-boot-couchbase/src/test/java/org/springframework/boot/couchbase/health/CouchbaseReactiveHealthIndicatorTests.java

@ -60,6 +60,7 @@ class CouchbaseReactiveHealthIndicatorTests { @@ -60,6 +60,7 @@ class CouchbaseReactiveHealthIndicatorTests {
given(reactiveCluster.diagnostics()).willReturn(Mono.just(diagnostics));
given(cluster.reactive()).willReturn(reactiveCluster);
Health health = healthIndicator.health().block(Duration.ofSeconds(30));
assertThat(health).isNotNull();
assertThat(health.getStatus()).isEqualTo(Status.UP);
assertThat(health.getDetails()).containsEntry("sdk", "test-sdk");
assertThat(health.getDetails()).containsKey("endpoints");
@ -85,6 +86,7 @@ class CouchbaseReactiveHealthIndicatorTests { @@ -85,6 +86,7 @@ class CouchbaseReactiveHealthIndicatorTests {
given(reactiveCluster.diagnostics()).willReturn(Mono.just(diagnostics));
given(cluster.reactive()).willReturn(reactiveCluster);
Health health = healthIndicator.health().block(Duration.ofSeconds(30));
assertThat(health).isNotNull();
assertThat(health.getStatus()).isEqualTo(Status.DOWN);
assertThat(health.getDetails()).containsEntry("sdk", "test-sdk");
assertThat(health.getDetails()).containsKey("endpoints");

Loading…
Cancel
Save