lucliu1108 commented on code in PR #23859:
URL: https://github.com/apache/kafka/pull/23859#discussion_r4542899728
##########
clients/clients-integration-tests/src/test/java/org/apache/kafka/clients/admin/DescribeConfigsTest.java:
##########
@@ -76,4 +85,44 @@ public void
testDescribeConfigsTopicWithInternalListConfig(ClusterInstance clust
assertEquals("0:101", entry.value());
}
}
+
+ // Cluster-wide configs are described from
DynamicBrokerConfig#currentDynamicDefaultConfigs, which holds raw
+ // strings. A LIST config must be returned as the raw string instead of
being cast to a List.
+ @ClusterTest
+ public void testDescribeConfigsClusterWideListConfig(ClusterInstance
cluster) throws Exception {
+ ConfigResource clusterResource = new
ConfigResource(ConfigResource.Type.BROKER, "");
+ try (Admin admin = cluster.admin()) {
+ admin.incrementalAlterConfigs(Map.of(clusterResource, List.of(new
AlterConfigOp(
+ new ConfigEntry(ServerLogConfigs.LOG_CLEANUP_POLICY_CONFIG,
"compact,delete"),
+ AlterConfigOp.OpType.SET)))).all().get();
+ AtomicReference<ConfigEntry> entry = new AtomicReference<>();
+ TestUtils.waitForCondition(() -> {
+ entry.set(describeConfig(admin, clusterResource,
ServerLogConfigs.LOG_CLEANUP_POLICY_CONFIG));
+ return entry.get().source() ==
ConfigEntry.ConfigSource.DYNAMIC_DEFAULT_BROKER_CONFIG;
+ }, ServerLogConfigs.LOG_CLEANUP_POLICY_CONFIG + " was not applied
as a cluster-wide config");
+ assertEquals("compact,delete", entry.get().value());
+ assertEquals(ConfigEntry.ConfigType.LIST, entry.get().type());
+ }
+ }
+
+ // Listener-prefixed configs are not defined in the ConfigDef, so they are
described from the raw strings in
+ // originals(). The type still resolves to LIST through the base config,
so the raw string must not be cast to a List.
+ @ClusterTest(serverProperties = {
+ @ClusterConfigProperty(key = PREFIXED_SSL_ENABLED_PROTOCOLS_CONFIG,
value = "TLSv1.3,TLSv1.2")
Review Comment:
Fix: added `testDescribeConfigsPrefixedListenerClassConfig` to test a CLASS
config, similar to the previous `testDescribeConfigsPrefixedListenerListConfig`.
--
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]