showuon commented on code in PR #15659:
URL: https://github.com/apache/kafka/pull/15659#discussion_r1554536274


##########
tools/src/test/java/org/apache/kafka/tools/reassign/ReassignPartitionsUnitTest.java:
##########
@@ -300,6 +300,12 @@ public void testGetReplicaAssignments() throws Exception {
 
             assertEquals(assignments,
                 getReplicaAssignmentForPartitions(adminClient, new 
HashSet<>(asList(new TopicPartition("foo", 0), new TopicPartition("bar", 0)))));
+
+            assignments.clear();
+
+            UnknownTopicOrPartitionException exception = 
assertThrows(UnknownTopicOrPartitionException.class,
+                () -> getReplicaAssignmentForPartitions(adminClient, new 
HashSet<>(asList(new TopicPartition("foo", 0), new TopicPartition("foo", 
10)))));
+            assertEquals("Unable to find partition: foo-10", 
exception.getMessage());

Review Comment:
   If we change it to ExecutionException, should we change this? Ex:
   ```
   Exception  exception = assertThrows(ExecutionException.class,
                   () -> getReplicaAssignmentForPartitions(adminClient, new 
HashSet<>(asList(new TopicPartition("foo", 0), new TopicPartition("foo", 
10)))));
   Exception causeException = exception.getCause();
   AssertTrue(causeException instanceof UnknownTopicOrPartitionException);
   assertEquals("Unable to find partition: foo-10", 
causeException.getMessage());
   ```



-- 
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]

Reply via email to