arjunashok commented on code in PR #58:
URL: https://github.com/apache/cassandra-sidecar/pull/58#discussion_r1313509401
##########
client/src/testFixtures/java/org/apache/cassandra/sidecar/client/SidecarClientTest.java:
##########
@@ -255,6 +256,31 @@ public void testTimeSkewFromReplicaSet() throws Exception
validateResponseServed(ApiEndpointsV1.TIME_SKEW_ROUTE);
}
+ @Test
+ public void testTokenRangeReplicasFromReplicaSet() throws Exception
+ {
+ String keyspace = "test";
+ String tokenRangeReplicasAsString = "{\"replicaState\":{" +
+ "\"127.0.0.1:7000\":\"NORMAL\"}," +
+
"\"writeReplicas\":[{\"start\":\"-9223372036854775808\"," +
+
"\"end\":\"9223372036854775807\",\"replicasByDatacenter\":" +
+
"{\"datacenter1\":[\"127.0.0.1:7000\"]}}],\"readReplicas\":" +
+
"[{\"start\":\"-9223372036854775808\",\"end\":\"9223372036854775807\"," +
+
"\"replicasByDatacenter\":{\"datacenter1\":[\"127.0.0.1:7000\"]}}]}";
+ MockResponse response = new
MockResponse().setResponseCode(OK.code()).setBody(tokenRangeReplicasAsString);
+ enqueue(response);
+
+ TokenRangeReplicasResponse result =
client.tokenRangeReplicas(instances.subList(1, 2), keyspace)
+ .get(30, TimeUnit.SECONDS);
+ assertThat(result).isNotNull();
+ assertThat(result.writeReplicas()).hasSize(1);
Review Comment:
Addressed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]