You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Chia-Ping Tsai (Jira)" <ji...@apache.org> on 2026/09/09 04:20:00 UTC
[jira] [Created] (KAFKA-21054) Use assertThrows in InternalTopicManagerTest timeout tests
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)