fvaleri commented on code in PR #24252:
URL: https://github.com/apache/kafka/pull/24252#discussion_r4587306605


##########
clients/src/test/java/org/apache/kafka/common/internals/TopicTest.java:
##########
@@ -107,4 +109,21 @@ public void testTopicHasCollision() {
         for (int i = 0; i < periodFirstMiddleLastNone.size(); ++i)
             assertFalse(Topic.hasCollision(periodFirstMiddleLastNone.get(i), 
underscoreFirstMiddleLastNone.get(i)));
     }
+
+    @ParameterizedTest
+    @ValueSource(strings = {
+        "__consumer_offsets",
+        "__transaction_state",
+        "__share_group_state",
+        "__mirror_state"
+    })
+    public void testIsInternal(String topic) {
+        assertTrue(Topic.isInternal(topic));
+    }
+
+    @ParameterizedTest
+    @ValueSource(strings = {Topic.CLUSTER_METADATA_TOPIC_NAME, "foo"})
+    public void testIsNotInternal(String topic) {
+        assertFalse(Topic.isInternal(topic));
+    }

Review Comment:
   This is a bit confusing to read. __cluster_metadata is technically an 
internal topic, even if it is not included in the INTERNAL_TOPICS set, which is 
specifically about coordinator-owned state topics that go through 
AutoTopicCreationManager.
   
   What about renaming the tests to:
   - testCoordinatorTopicsAreInternal
   - testUserTopicsAreNotInternal and use `foo` and `bar` as topic names
   



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

Reply via email to