maedhroz commented on code in PR #4393:
URL: https://github.com/apache/cassandra/pull/4393#discussion_r2380336188


##########
test/unit/org/apache/cassandra/db/guardrails/GuardrailKeyspacePropertiesTest.java:
##########
@@ -0,0 +1,223 @@
+/*
+ * 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.db.guardrails;
+
+import static java.lang.String.format;
+import static org.apache.cassandra.db.guardrails.GuardrailTester.guardrails;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.apache.cassandra.schema.KeyspaceParams;
+import org.apache.cassandra.utils.LocalizeString;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Tests the guardrail for keyspace properties, {@link 
Guardrails#keyspaceProperties}.
+ */
+public class GuardrailKeyspacePropertiesTest extends GuardrailTester
+{
+    private static final String CREATE_KEYSPACE = "CREATE KEYSPACE %s %s";
+    private static final String ALTER_KEYSPACE = "ALTER KEYSPACE %s WITH %s";
+
+    private static final String WARNED_PROPERTY_NAME = 
"keyspace_properties_warned";
+    private static final String IGNORED_PROPERTY_NAME = 
"keyspace_properties_ignored";
+    private static final String DISALLOWED_PROPERTY_NAME = 
"keyspace_properties_disallowed";
+
+    public GuardrailKeyspacePropertiesTest()
+    {
+        super(Guardrails.keyspaceProperties);
+    }
+
+    @Before
+    public void before()
+    {
+        // Set up basic test configuration - only allow "replication" by 
default
+        Set<String> allowed = new HashSet<>(Arrays.asList("replication"));

Review Comment:
   ```suggestion
           Set<String> allowed = new HashSet<>(List.of("replication"));
   ```
   It's just test code, but `List.of()` saves some memory.



-- 
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]

Reply via email to