Chia-Ping Tsai created KAFKA-21054:
--------------------------------------

             Summary: Use assertThrows in InternalTopicManagerTest timeout tests
                 Key: KAFKA-21054
                 URL: https://issues.apache.org/jira/browse/KAFKA-21054
             Project: Kafka
          Issue Type: Test
            Reporter: Chia-Ping Tsai
            Assignee: Chia-Ping Tsai


{code:java}
        try {
            final Set<String> topic2set = Set.of(topic2);
            internalTopicManager.getTopicPartitionInfo(topic2set, null);        
} catch (final TimeoutException expected) {
            assertEquals(TimeoutException.class, 
expected.getCause().getClass());
        } {code}
{code:java}
        try {
            final Set<String> topic1set = Set.of(topic1);
            final Set<String> topic2set = new 
HashSet<>(Collections.singletonList(topic2));            
internalTopicManager.getNumPartitions(topic1set, topic2set);        } catch 
(final TimeoutException expected) {
            assertEquals(TimeoutException.class, 
expected.getCause().getClass());
        } {code}
It should leverage assertThrows to ensure it does throw exception.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to