[
https://issues.apache.org/jira/browse/KAFKA-21054?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chia-Ping Tsai resolved KAFKA-21054.
------------------------------------
Fix Version/s: 4.5.0
Resolution: Fixed
> Use assertThrows in InternalTopicManagerTest timeout tests
> ----------------------------------------------------------
>
> Key: KAFKA-21054
> URL: https://issues.apache.org/jira/browse/KAFKA-21054
> Project: Kafka
> Issue Type: Test
> Components: streams, unit tests
> Reporter: Chia-Ping Tsai
> Assignee: KC.H
> Priority: Minor
> Fix For: 4.5.0
>
>
> {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
(v10.3.26#10030026)