5 commented on code in PR #198:
URL: https://github.com/apache/cassandra-sidecar/pull/198#discussion_r1988206374


##########
client/src/testFixtures/java/org/apache/cassandra/sidecar/client/SidecarClientTest.java:
##########
@@ -1673,6 +1677,42 @@ public void onError(Throwable throwable)
         assertThat(new String(baos.toByteArray(), 
StandardCharsets.UTF_8)).isEqualTo("Test Content");
     }
 
+    @Test
+    public void testReportSchemaSuccess()
+    {
+        MockResponse response = new MockResponse()
+                .setResponseCode(OK.code())
+                .setBody("");
+
+        enqueue(response);
+
+        SidecarInstance instance = instances.get(0);
+
+        CompletableFuture<Void> future = client.reportSchema(instance);
+
+        assertDoesNotThrow(() ->
+                future.whenComplete((ignored, throwable) -> 
assertNull(throwable))
+                      .join());
+    }
+
+    @Test
+    public void testReportSchemaFailure()
+    {
+        MockResponse response = new MockResponse()
+                .setResponseCode(INTERNAL_SERVER_ERROR.code())
+                .setBody("Message");
+
+        enqueue(response);
+
+        SidecarInstance instance = instances.get(0);
+
+        CompletableFuture<Void> future = client.reportSchema(instance);
+
+        assertThrows(CompletionException.class, () ->
+                future.whenComplete((ignored, throwable) -> 
assertNotNull(throwable))
+                      .join());
+    }
+

Review Comment:
   I've changed these a lot, let me know if the formatting still needs change.



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to