FrankYang0529 commented on code in PR #16493:
URL: https://github.com/apache/kafka/pull/16493#discussion_r1743982236
##########
core/src/test/java/kafka/admin/AclCommandTest.java:
##########
@@ -246,32 +275,54 @@ public void
testProducerConsumerCliWithAuthorizer(ClusterInstance cluster) {
@ClusterConfigProperty(key = AUTHORIZER_CLASS_NAME_CONFIG,
value = STANDARD_AUTHORIZER)
})
})
- public void testProducerConsumerCliWithAdminAPI(ClusterInstance cluster) {
+ public void testProducerConsumerCliWithAdminAPI(ClusterInstance cluster)
throws InterruptedException {
testProducerConsumerCli(cluster, adminArgs(cluster.bootstrapServers(),
Optional.empty()));
}
+ @ClusterTest(types = {Type.KRAFT}, serverProperties = {
+ @ClusterConfigProperty(key = AUTHORIZER_CLASS_NAME_CONFIG, value =
STANDARD_AUTHORIZER)
+ })
+ public void
testProducerConsumerCliWithAdminAPIAndBootstrapController(ClusterInstance
cluster) throws InterruptedException {
+ testProducerConsumerCli(cluster,
adminArgsWithBootstrapController(cluster.bootstrapControllers(),
Optional.empty()));
+ }
+
@ClusterTests({
@ClusterTest(types = {Type.ZK}),
@ClusterTest(types = {Type.KRAFT}, serverProperties = {
@ClusterConfigProperty(key = AUTHORIZER_CLASS_NAME_CONFIG,
value = STANDARD_AUTHORIZER)
})
})
public void testAclCliWithClientId(ClusterInstance cluster) {
- LogCaptureAppender appender = LogCaptureAppender.createAndRegister();
- appender.setClassLogger(AppInfoParser.class, Level.WARN);
- try {
+ try (LogCaptureAppender appender =
LogCaptureAppender.createAndRegister()) {
+ appender.setClassLogger(AppInfoParser.class, Level.WARN);
testAclCli(cluster, adminArgs(cluster.bootstrapServers(),
Optional.of(TestUtils.tempFile("client.id=my-client"))));
- } finally {
- appender.close();
+ assertEquals(0, appender.getEvents().stream()
+ .filter(e -> e.getLevel().equals(Level.WARN.toString()))
+ .filter(e -> e.getThrowableClassName().filter(name ->
name.equals(InstanceAlreadyExistsException.class.getName())).isPresent())
+ .count(), "There should be no warnings about multiple
registration of mbeans");
+ } catch (InterruptedException | IOException e) {
Review Comment:
Hi @chia7712, thanks for your review. I add exceptions to the method
signature.
--
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]