This repository was archived by the owner on Jan 24, 2024. It is now read-only.
support delete topics using the kafka client#348
Merged
BewareMyPower merged 2 commits intostreamnative:masterfrom Jan 27, 2021
Merged
support delete topics using the kafka client#348BewareMyPower merged 2 commits intostreamnative:masterfrom
BewareMyPower merged 2 commits intostreamnative:masterfrom
Conversation
9dad8bf to
2749652
Compare
Collaborator
|
Add a test to verify deleting an empty topic throws an 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 21cf192..1b393ca 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
@@ -376,6 +376,23 @@ public class KafkaRequestHandlerTest extends KopProtocolHandlerTestBase {
verifyTopicsDeletedByPulsarAdmin(topicToNumPartitions);
}
+ @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 testCreateInvalidTopics() {
Properties props = new Properties(); |
28a880f to
2f8532b
Compare
BewareMyPower
approved these changes
Jan 27, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #347