gabriellefu commented on code in PR #23121:
URL: https://github.com/apache/kafka/pull/23121#discussion_r3868439144


##########
core/src/test/scala/unit/kafka/server/ControllerConfigurationValidatorTest.scala:
##########
@@ -219,6 +224,25 @@ class ControllerConfigurationValidatorTest {
     config.put("foobar", "abc")
     assertEquals("Unknown group config name: foobar",
       assertThrows(classOf[InvalidConfigurationException], () => 
validator.validate(
-        new ConfigResource(GROUP, "group"), config, emptyMap())).getMessage)
+        new ConfigResource(GROUP, "group"), config, emptyMap(), 
preGroupBrokerValidationMv)).getMessage)
+  }
+
+  @Test
+  def testInvalidGroupConfigStillRejectedBelowGatedMetadataVersion(): Unit = {
+    val config = new util.TreeMap[String, String]()
+    config.put("foobar", "abc")
+    assertEquals("Unknown group config name: foobar",
+      assertThrows(classOf[InvalidConfigurationException], () => 
validator.validate(
+        new ConfigResource(GROUP, "group"), config, emptyMap(), 
MetadataVersion.IBP_4_4_IV2)).getMessage)
+  }
+
+  @Test
+  def 
testInvalidGroupConfigSkippedOnceMetadataVersionGuaranteesBrokerValidation(): 
Unit = {
+    // Once every broker in the cluster is guaranteed to already validate this 
on the forwarding
+    // broker (see ConfigAdminManager#validateGroupConfigChangeOnBroker), the 
controller no longer
+    // needs to, and an otherwise-invalid config is let through here.
+    val config = new util.TreeMap[String, String]()
+    config.put("foobar", "abc")
+    validator.validate(new ConfigResource(GROUP, "group"), config, emptyMap(), 
MetadataVersion.IBP_4_5_IV0)
   }

Review Comment:
   thanks,  I have deleted the duplicated tests and now we only have 
testInvalidGroupConfigRejectedBelowMetadataVersion4_5, and 
testInvalidGroupConfigNotValidatedAfterMetadataVersion4_5 for the skip 
validation side



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