diff --git a/tests/src/test/java/io/streamnative/pulsar/handlers/kop/KafkaRequestHandlerTest.java b/tests/src/test/java/io/streamnative/pulsar/handlers/kop/KafkaRequestHandlerTest.java index 21cf192b9d..64a7206a4d 100644 --- a/tests/src/test/java/io/streamnative/pulsar/handlers/kop/KafkaRequestHandlerTest.java +++ b/tests/src/test/java/io/streamnative/pulsar/handlers/kop/KafkaRequestHandlerTest.java @@ -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 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();