Skip to content

Commit

Permalink
Adapt to breaking changes in Couchbase Driver 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinsona committed May 13, 2022
1 parent a7a4e97 commit 3892b56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Expand Up @@ -51,8 +51,9 @@ void couchbaseClusterIsUp() {
Cluster cluster = mock(Cluster.class);
CouchbaseHealthIndicator healthIndicator = new CouchbaseHealthIndicator(cluster);
Map<ServiceType, List<EndpointDiagnostics>> endpoints = Collections.singletonMap(ServiceType.KV,
Collections.singletonList(new EndpointDiagnostics(ServiceType.KV, EndpointState.CONNECTED, "127.0.0.1",
"127.0.0.1", Optional.empty(), Optional.of(1234L), Optional.of("endpoint-1"))));
Collections.singletonList(
new EndpointDiagnostics(ServiceType.KV, EndpointState.CONNECTED, "127.0.0.1", "127.0.0.1",
Optional.empty(), Optional.of(1234L), Optional.of("endpoint-1"), Optional.empty())));

DiagnosticsResult diagnostics = new DiagnosticsResult(endpoints, "test-sdk", "test-id");
given(cluster.diagnostics()).willReturn(diagnostics);
Expand All @@ -72,9 +73,9 @@ void couchbaseClusterIsDown() {
Map<ServiceType, List<EndpointDiagnostics>> endpoints = Collections.singletonMap(ServiceType.KV,
Arrays.asList(
new EndpointDiagnostics(ServiceType.KV, EndpointState.CONNECTED, "127.0.0.1", "127.0.0.1",
Optional.empty(), Optional.of(1234L), Optional.of("endpoint-1")),
Optional.empty(), Optional.of(1234L), Optional.of("endpoint-1"), Optional.empty()),
new EndpointDiagnostics(ServiceType.KV, EndpointState.CONNECTING, "127.0.0.1", "127.0.0.1",
Optional.empty(), Optional.of(1234L), Optional.of("endpoint-2"))));
Optional.empty(), Optional.of(1234L), Optional.of("endpoint-2"), Optional.empty())));
DiagnosticsResult diagnostics = new DiagnosticsResult(endpoints, "test-sdk", "test-id");
given(cluster.diagnostics()).willReturn(diagnostics);
Health health = healthIndicator.health();
Expand Down
Expand Up @@ -49,8 +49,9 @@ void couchbaseClusterIsUp() {
Cluster cluster = mock(Cluster.class);
CouchbaseReactiveHealthIndicator healthIndicator = new CouchbaseReactiveHealthIndicator(cluster);
Map<ServiceType, List<EndpointDiagnostics>> endpoints = Collections.singletonMap(ServiceType.KV,
Collections.singletonList(new EndpointDiagnostics(ServiceType.KV, EndpointState.CONNECTED, "127.0.0.1",
"127.0.0.1", Optional.empty(), Optional.of(1234L), Optional.of("endpoint-1"))));
Collections.singletonList(
new EndpointDiagnostics(ServiceType.KV, EndpointState.CONNECTED, "127.0.0.1", "127.0.0.1",
Optional.empty(), Optional.of(1234L), Optional.of("endpoint-1"), Optional.empty())));
DiagnosticsResult diagnostics = new DiagnosticsResult(endpoints, "test-sdk", "test-id");
given(cluster.diagnostics()).willReturn(diagnostics);
Health health = healthIndicator.health().block(Duration.ofSeconds(30));
Expand All @@ -69,9 +70,9 @@ void couchbaseClusterIsDown() {
Map<ServiceType, List<EndpointDiagnostics>> endpoints = Collections.singletonMap(ServiceType.KV,
Arrays.asList(
new EndpointDiagnostics(ServiceType.KV, EndpointState.CONNECTED, "127.0.0.1", "127.0.0.1",
Optional.empty(), Optional.of(1234L), Optional.of("endpoint-1")),
Optional.empty(), Optional.of(1234L), Optional.of("endpoint-1"), Optional.empty()),
new EndpointDiagnostics(ServiceType.KV, EndpointState.CONNECTING, "127.0.0.1", "127.0.0.1",
Optional.empty(), Optional.of(1234L), Optional.of("endpoint-2"))));
Optional.empty(), Optional.of(1234L), Optional.of("endpoint-2"), Optional.empty())));
DiagnosticsResult diagnostics = new DiagnosticsResult(endpoints, "test-sdk", "test-id");
given(cluster.diagnostics()).willReturn(diagnostics);
Health health = healthIndicator.health().block(Duration.ofSeconds(30));
Expand Down

0 comments on commit 3892b56

Please sign in to comment.