AndrewJSchofield commented on code in PR #14811:
URL: https://github.com/apache/kafka/pull/14811#discussion_r1404634074
##########
clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java:
##########
@@ -7090,6 +7093,51 @@ private static MemberDescription
convertToMemberDescriptions(DescribedGroupMembe
assignment);
}
+ @Test
+ public void testListClientMetricsResources() throws Exception {
+ try (AdminClientUnitTestEnv env = mockClientEnv()) {
+ List<ClientMetricsResourceListing> expected = Arrays.asList(
+ new ClientMetricsResourceListing("one"),
+ new ClientMetricsResourceListing("two")
+ );
+
+ ListClientMetricsResourcesResponseData responseData =
+ new
ListClientMetricsResourcesResponseData().setErrorCode(Errors.NONE.code());
+
+ responseData.clientMetricsResources()
+ .add(new
ListClientMetricsResourcesResponseData.ClientMetricsResource().setName("one"));
+ responseData.clientMetricsResources()
+ .add((new
ListClientMetricsResourcesResponseData.ClientMetricsResource()).setName("two"));
+
+ env.kafkaClient().prepareResponse(
+ request -> request instanceof
ListClientMetricsResourcesRequest,
+ new ListClientMetricsResourcesResponse(responseData));
+
+ ListClientMetricsResourcesResult result =
env.adminClient().listClientMetricsResources();
+ assertEquals(new HashSet<>(expected), new
HashSet<>(result.all().get()));
+ }
+ }
+
+ @Test
+ public void testListClientMetricsResourcesNotSupported() throws Exception {
Review Comment:
That appears true to me too, but all of the other tests in that source file
are the same pattern. I am going for consistency here.
--
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]