Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
add testDeleteNotExistedTopics test
Browse files Browse the repository at this point in the history
  • Loading branch information
dockerzhang committed Jan 26, 2021
1 parent 2749652 commit 2f8532b
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,23 @@ public void testCreateInvalidTopics() {
}
}

@Test(timeOut = 10000)
public void testDeleteNotExistedTopics() throws Exception {
Properties props = new Properties();
props.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:" + getKafkaBrokerPort());

@Cleanup
AdminClient kafkaAdmin = AdminClient.create(props);
Set<String> topics = new HashSet<>();
topics.add("testDeleteNotExistedTopics");
try {
deleteTopicsByKafkaAdmin(kafkaAdmin, topics);
fail();
} catch (ExecutionException e) {
assertTrue(e.getCause() instanceof UnknownTopicOrPartitionException);
}
}

@Test(timeOut = 10000)
public void testDescribeTopics() throws Exception {
Properties props = new Properties();
Expand Down

0 comments on commit 2f8532b

Please sign in to comment.