use of com.couchbase.client.java.kv.GetReplicaResult in project couchbase-jvm-clients by couchbase.
the class ReplicaReadIntegrationTest method reactiveGetAnyReturnsResult.
@Test
void reactiveGetAnyReturnsResult() throws Exception {
String id = UUID.randomUUID().toString();
collection.upsert(id, "Hello, World!");
GetReplicaResult result = collection.reactive().getAnyReplica(id).block();
assertNotNull(result);
assertEquals("Hello, World!", result.contentAs(String.class));
}
use of com.couchbase.client.java.kv.GetReplicaResult in project couchbase-jvm-clients by couchbase.
the class ReplicaReadIntegrationTest method reactiveGetAllReturnsResult.
@Test
void reactiveGetAllReturnsResult() throws Exception {
String id = UUID.randomUUID().toString();
collection.upsert(id, "Hello, World!");
List<GetReplicaResult> results = collection.reactive().getAllReplicas(id).collectList().block();
assertNotNull(results);
assertNotEquals(0, results.size());
int primaryCount = 0;
for (GetReplicaResult result : results) {
if (!result.isReplica()) {
primaryCount++;
}
assertEquals("Hello, World!", result.contentAs(String.class));
}
assertEquals(1, primaryCount);
}
Aggregations