Icewind52 commented on code in PR #24247:
URL: https://github.com/apache/kafka/pull/24247#discussion_r4630853951
##########
metadata/src/test/java/org/apache/kafka/metadata/KafkaConfigSchemaTest.java:
##########
@@ -102,10 +102,19 @@ public void testTranslateConfigSources() {
DescribeConfigsResponse.ConfigSource.CLIENT_METRICS_CONFIG);
testTranslateConfigSource(ConfigEntry.ConfigSource.DYNAMIC_GROUP_CONFIG,
DescribeConfigsResponse.ConfigSource.GROUP_CONFIG);
+
testTranslateConfigSource(ConfigEntry.ConfigSource.DYNAMIC_CLUSTER_MIRROR_CONFIG,
+ DescribeConfigsResponse.ConfigSource.CLUSTER_MIRROR_CONFIG);
testTranslateConfigSource(ConfigEntry.ConfigSource.DEFAULT_CONFIG,
DescribeConfigsResponse.ConfigSource.DEFAULT_CONFIG);
}
+ @Test
+ public void testEveryConfigSourceHasWireRepresentation() {
+ for (ConfigEntry.ConfigSource source :
ConfigEntry.ConfigSource.values()) {
+ assertEquals(source,
KafkaConfigSchema.translateConfigSource(source).source(), source.name());
+ }
+ }
+
Review Comment:
Done, switched to @ParameterizedTest + @EnumSource. I worded the comment
differently: if someone adds both enum values, this test passes even without a
testTranslateConfigSources row. What it catches is a public source with no wire
counterpart, which translateConfigSource silently maps to UNKNOWN.
--
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]