AndrewJSchofield commented on code in PR #21385:
URL: https://github.com/apache/kafka/pull/21385#discussion_r2769521373
##########
tools/src/test/java/org/apache/kafka/tools/ConfigCommandTest.java:
##########
@@ -1413,6 +1416,33 @@ public void shouldNotAlterGroupConfigWithoutEntityName()
{
assertEquals("An entity name must be specified with --alter of
groups", exception.getMessage());
}
+ @Test
+ public void testDescribeGroupConfigOldBroker() {
+ ConfigCommand.ConfigCommandOptions describeOpts = new
ConfigCommand.ConfigCommandOptions(toArray("--bootstrap-server",
"localhost:9092",
+ "--entity-type", "groups",
+ "--describe"));
+
+ KafkaFutureImpl<Collection<ConfigResource>> future = new
KafkaFutureImpl<>();
+ ListConfigResourcesResult listConfigResourcesResult =
mock(ListConfigResourcesResult.class);
+ when(listConfigResourcesResult.all()).thenReturn(future);
+
+ AtomicBoolean listedConfigResources = new AtomicBoolean(false);
+ Node node = new Node(1, "localhost", 9092);
+ MockAdminClient mockAdminClient = new MockAdminClient(List.of(node),
node) {
+ @Override
+ public ListConfigResourcesResult
listConfigResources(Set<ConfigResource.Type> configResourceTypes,
ListConfigResourcesOptions options) {
+ ConfigResource.Type type =
configResourceTypes.iterator().next();
+ assertEquals(ConfigResource.Type.GROUP, type);
+ future.completeExceptionally(new
UnsupportedVersionException("The v0 ListConfigResources only supports
CLIENT_METRICS"));
Review Comment:
Done
--
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]