isaacreath commented on code in PR #264: URL: https://github.com/apache/cassandra-sidecar/pull/264#discussion_r2478794726
########## integration-tests/src/integrationTest/org/apache/cassandra/sidecar/routes/v2/V2NodeSettingsIntegrationTest.java: ########## @@ -0,0 +1,110 @@ +/* + * 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.v2; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import io.vertx.core.VertxException; +import io.vertx.core.buffer.Buffer; +import io.vertx.core.http.HttpResponseExpectation; +import io.vertx.ext.web.client.HttpResponse; +import org.apache.cassandra.sidecar.common.response.v2.V2NodeSettings; +import org.apache.cassandra.sidecar.testing.SharedClusterSidecarIntegrationTestBase; + +import static io.netty.handler.codec.http.HttpResponseStatus.SERVICE_UNAVAILABLE; +import static org.apache.cassandra.testing.utils.AssertionUtils.getBlocking; +import static org.apache.cassandra.testing.utils.AssertionUtils.loopAssert; +import static org.assertj.core.api.Assertions.assertThat; + +/** + * V2NodeSettingsIntegrationTest is responsible for verifying the behavior of the /api/v2/cassandra/settings + * endpoint. This includes: + * - Node settings are returned when the node is healthy. + * - A specific error is returned when CQL is not healthy. + * - A separate error is returned when the node is down. + */ +public class V2NodeSettingsIntegrationTest extends SharedClusterSidecarIntegrationTestBase +{ + + @Test + public void testV2NodeSettings() + { + ensureSettingsAvailable(); + + // Disabling NTR should make CQL settings become unavailable + cluster.getFirstRunningInstance().nodetool("disablebinary"); + ensureSettingsBecomeUnavailable("CQL NodeSettings unavailable"); + + // Re-enable NTR, settings should become available again. + cluster.getFirstRunningInstance().nodetool("enablebinary"); + ensureSettingsAvailable(); + + // Changing a configuration should eventually reflect in settings API. + cluster.getFirstRunningInstance().nodetool("setconcurrency", "READ", "10"); + ensureSettingsAvailable(); Review Comment: Addressed in https://github.com/apache/cassandra-sidecar/pull/264/commits/3b5a9b8148abb6749b2272c67cb655fea764e08a -- 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]

