You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "KC.H (Jira)" <ji...@apache.org> on 2026/09/09 04:22:00 UTC
[jira] [Assigned] (KAFKA-21054) Use assertThrows in InternalTopicManagerTest timeout tests
[ https://issues.apache.org/jira/browse/KAFKA-21054?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
KC.H reassigned KAFKA-21054:
----------------------------
Assignee: KC.H (was: Chia-Ping Tsai)
> 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: 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)