frankgh commented on code in PR #144:
URL: https://github.com/apache/cassandra-sidecar/pull/144#discussion_r1917192382
##########
server/src/test/java/org/apache/cassandra/sidecar/routes/OperationalJobHandlerTest.java:
##########
@@ -124,6 +124,8 @@ void testGetJobStatusRunningJob(VertxTestContext context)
.expect(ResponsePredicate.SC_ACCEPTED)
.send(context.succeeding(response -> {
assertThat(response.statusCode()).isEqualTo(ACCEPTED.code());
+ LOGGER.info("Response Status: {}", response.statusCode());
Review Comment:
is this useful in tests? we already know the status code is accepted by this
point?
##########
server/src/test/integration/org/apache/cassandra/sidecar/routes/NodeDecommissionIntegrationTest.java:
##########
@@ -0,0 +1,134 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.sidecar.routes;
+
+import java.util.UUID;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+
+import com.google.common.util.concurrent.Uninterruptibles;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+import io.netty.handler.codec.http.HttpResponseStatus;
+import io.vertx.core.buffer.Buffer;
+import io.vertx.ext.web.client.HttpResponse;
+import io.vertx.junit5.VertxExtension;
+import io.vertx.junit5.VertxTestContext;
+import org.apache.cassandra.sidecar.common.data.OperationalJobStatus;
+import org.apache.cassandra.sidecar.common.response.OperationalJobResponse;
+import org.apache.cassandra.sidecar.testing.IntegrationTestBase;
+import org.apache.cassandra.testing.CassandraIntegrationTest;
+
+import static org.apache.cassandra.sidecar.AssertionUtils.loopAssert;
+import static
org.apache.cassandra.sidecar.common.data.OperationalJobStatus.FAILED;
+import static
org.apache.cassandra.sidecar.common.data.OperationalJobStatus.RUNNING;
+import static
org.apache.cassandra.sidecar.common.data.OperationalJobStatus.SUCCEEDED;
+import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
+
+/**
+ * Test the node decommission endpoint with cassandra container.
+ */
+@ExtendWith(VertxExtension.class)
+public class NodeDecommissionIntegrationTest extends IntegrationTestBase
+{
+ @CassandraIntegrationTest(nodesPerDc = 2)
+ void decommissionNodeDefault(VertxTestContext context)
+ {
+ final AtomicReference<String> jobId = new AtomicReference<>();
+ String testRoute =
"/api/v1/cassandra/operations/decommission?force=true";
+ testWithClient(client -> client.put(server.actualPort(), "127.0.0.1",
testRoute)
+ .send(context.succeeding(response -> {
+ logger.info("Response Status:" +
response.statusCode());
Review Comment:
not sure what the real value of log here is , maybe just assert ?
##########
server/src/test/java/org/apache/cassandra/sidecar/routes/OperationalJobHandlerTest.java:
##########
@@ -138,6 +140,8 @@ void testGetJobStatusCompletedJob(VertxTestContext context)
.send(context.succeeding(response -> {
assertThat(response.statusCode()).isEqualTo(OK.code());
OperationalJobResponse jobStatus =
response.bodyAsJson(OperationalJobResponse.class);
+ LOGGER.info("Response Status: {}", response.statusCode());
Review Comment:
same comment about logging
##########
server/src/test/java/org/apache/cassandra/sidecar/routes/OperationalJobHandlerTest.java:
##########
@@ -124,6 +124,8 @@ void testGetJobStatusRunningJob(VertxTestContext context)
.expect(ResponsePredicate.SC_ACCEPTED)
.send(context.succeeding(response -> {
assertThat(response.statusCode()).isEqualTo(ACCEPTED.code());
+ LOGGER.info("Response Status: {}", response.statusCode());
+ LOGGER.info("Response Body: {}", response.bodyAsString());
Review Comment:
I find that logging this here is not useful, maybe just validate the payload
--
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]