[
https://issues.apache.org/jira/browse/KAFKA-21054?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Matthias J. Sax updated KAFKA-21054:
------------------------------------
Component/s: streams
unit tests
> 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
>
> {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)