AndrewJSchofield commented on code in PR #18825:
URL: https://github.com/apache/kafka/pull/18825#discussion_r1957107949
##########
clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java:
##########
@@ -1419,10 +1419,10 @@ public void
testDeleteTopicsDontRetryThrottlingExceptionWhenDisabled() throws Ex
new DeleteTopicsOptions().retryOnQuotaViolation(false));
assertNull(result.topicNameValues().get("topic1").get());
- ThrottlingQuotaExceededException e =
TestUtils.assertFutureThrows(result.topicNameValues().get("topic2"),
- ThrottlingQuotaExceededException.class);
+ ThrottlingQuotaExceededException e =
TestUtils.assertFutureThrows(ThrottlingQuotaExceededException.class,
result.topicNameValues().get("topic2")
+ );
Review Comment:
nit: Orphaned `)` on its own line.
##########
clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java:
##########
@@ -2653,10 +2653,10 @@ public void
testCreatePartitionsDontRetryThrottlingExceptionWhenDisabled() throw
counts, new
CreatePartitionsOptions().retryOnQuotaViolation(false));
assertNull(result.values().get("topic1").get());
- ThrottlingQuotaExceededException e =
TestUtils.assertFutureThrows(result.values().get("topic2"),
- ThrottlingQuotaExceededException.class);
+ ThrottlingQuotaExceededException e =
TestUtils.assertFutureThrows(ThrottlingQuotaExceededException.class,
result.values().get("topic2")
+ );
Review Comment:
nit: Orphaned `)` on its own line.
##########
clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java:
##########
@@ -1152,10 +1152,10 @@ public void
testCreateTopicsDontRetryThrottlingExceptionWhenDisabled() throws Ex
new CreateTopicsOptions().retryOnQuotaViolation(false));
assertNull(result.values().get("topic1").get());
- ThrottlingQuotaExceededException e =
TestUtils.assertFutureThrows(result.values().get("topic2"),
- ThrottlingQuotaExceededException.class);
+ ThrottlingQuotaExceededException e =
TestUtils.assertFutureThrows(ThrottlingQuotaExceededException.class,
result.values().get("topic2")
+ );
Review Comment:
nit: Orphaned `)` on its own line.
##########
clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java:
##########
@@ -1493,7 +1493,7 @@ public void testInvalidTopicNames() throws Exception {
Map<String, KafkaFuture<Void>> createFutures =
env.adminClient().createTopics(newTopics).values();
for (String sillyTopicName : sillyTopicNames) {
- TestUtils.assertFutureThrows(createFutures
.get(sillyTopicName), InvalidTopicException.class);
+ TestUtils.assertFutureThrows(InvalidTopicException.class,
createFutures .get(sillyTopicName));
Review Comment:
nit: Unnecessary space in `createFutures .get`.
##########
clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java:
##########
@@ -1440,10 +1440,10 @@ public void
testDeleteTopicsDontRetryThrottlingExceptionWhenDisabled() throws Ex
new DeleteTopicsOptions().retryOnQuotaViolation(false));
assertNull(resultIds.topicIdValues().get(topicId1).get());
- e =
TestUtils.assertFutureThrows(resultIds.topicIdValues().get(topicId2),
- ThrottlingQuotaExceededException.class);
+ e =
TestUtils.assertFutureThrows(ThrottlingQuotaExceededException.class,
resultIds.topicIdValues().get(topicId2)
+ );
Review Comment:
nit: Orphaned `)` on its own line.
##########
clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java:
##########
@@ -2625,10 +2625,10 @@ public void
testCreatePartitionsRetryThrottlingExceptionWhenEnabledUntilRequestT
time.sleep(defaultApiTimeout + 1);
assertNull(result.values().get("topic1").get());
- ThrottlingQuotaExceededException e =
TestUtils.assertFutureThrows(result.values().get("topic2"),
- ThrottlingQuotaExceededException.class);
+ ThrottlingQuotaExceededException e =
TestUtils.assertFutureThrows(ThrottlingQuotaExceededException.class,
result.values().get("topic2")
+ );
Review Comment:
nit: Orphaned `)` on its own line.
##########
clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java:
##########
@@ -1395,10 +1395,10 @@ public void
testDeleteTopicsRetryThrottlingExceptionWhenEnabledUntilRequestTimeO
time.sleep(defaultApiTimeout + 1);
assertNull(resultIds.topicIdValues().get(topicId1).get());
- e =
TestUtils.assertFutureThrows(resultIds.topicIdValues().get(topicId2),
- ThrottlingQuotaExceededException.class);
+ e =
TestUtils.assertFutureThrows(ThrottlingQuotaExceededException.class,
resultIds.topicIdValues().get(topicId2)
+ );
Review Comment:
nit: Orphaned `)` on its own line.
##########
core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala:
##########
@@ -2225,14 +2227,14 @@ class PlaintextAdminIntegrationTest extends
BaseAdminIntegrationTest {
val expectedOperations =
AclEntry.supportedOperations(ResourceType.GROUP)
assertEquals(expectedOperations,
testGroupDescription.authorizedOperations())
- // Test that the fake group throws GroupIdNotFoundException
-
assertTrue(describeWithFakeGroupResult.describedGroups().containsKey(fakeGroupId))
-
assertFutureThrows(describeWithFakeGroupResult.describedGroups().get(fakeGroupId),
- classOf[GroupIdNotFoundException], s"Group $fakeGroupId not found.")
+ // Test that the fake group throws GroupIdNotFoundException
Review Comment:
The indentation is changed in several changes in this file.
##########
clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java:
##########
@@ -1358,10 +1358,10 @@ public void
testDeleteTopicsRetryThrottlingExceptionWhenEnabledUntilRequestTimeO
time.sleep(defaultApiTimeout + 1);
assertNull(result.topicNameValues().get("topic1").get());
- ThrottlingQuotaExceededException e =
TestUtils.assertFutureThrows(result.topicNameValues().get("topic2"),
- ThrottlingQuotaExceededException.class);
+ ThrottlingQuotaExceededException e =
TestUtils.assertFutureThrows(ThrottlingQuotaExceededException.class,
result.topicNameValues().get("topic2")
+ );
Review Comment:
nit: Orphaned `)` on its own line.
##########
clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java:
##########
@@ -1125,10 +1125,10 @@ public void
testCreateTopicsRetryThrottlingExceptionWhenEnabledUntilRequestTimeO
time.sleep(defaultApiTimeout + 1);
assertNull(result.values().get("topic1").get());
- ThrottlingQuotaExceededException e =
TestUtils.assertFutureThrows(result.values().get("topic2"),
- ThrottlingQuotaExceededException.class);
+ ThrottlingQuotaExceededException e =
TestUtils.assertFutureThrows(ThrottlingQuotaExceededException.class,
result.values().get("topic2")
+ );
Review Comment:
nit: Orphaned `)` on its own line.
##########
clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java:
##########
@@ -1888,11 +1888,11 @@ public void testDescribeAcls() throws Exception {
env.kafkaClient().prepareResponse(new DescribeAclsResponse(new
DescribeAclsResponseData()
.setErrorCode(Errors.SECURITY_DISABLED.code())
.setErrorMessage("Security is disabled"),
ApiKeys.DESCRIBE_ACLS.latestVersion()));
-
TestUtils.assertFutureThrows(env.adminClient().describeAcls(FILTER2).values(),
SecurityDisabledException.class);
+ TestUtils.assertFutureThrows(SecurityDisabledException.class,
env.adminClient().describeAcls(FILTER2).values());
// Test a call where we supply an invalid filter.
-
TestUtils.assertFutureThrows(env.adminClient().describeAcls(UNKNOWN_FILTER).values(),
- InvalidRequestException.class);
+ TestUtils.assertFutureThrows(InvalidRequestException.class,
env.adminClient().describeAcls(UNKNOWN_FILTER).values()
+ );
Review Comment:
nit: Orphaned `)` on its own line.
--
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]