noojung commented on code in PR #23567:
URL: https://github.com/apache/kafka/pull/23567#discussion_r4097598130
##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/standalone/StandaloneHerderTest.java:
##########
@@ -281,12 +282,18 @@ public void testDestroyConnector() throws Exception {
Herder.Created<ConnectorInfo> connectorInfo =
createCallback.get(WAIT_TIME_MS, TimeUnit.MILLISECONDS);
assertEquals(createdInfo(SourceSink.SOURCE), connectorInfo.result());
+ TopicStatus fooStatus = new TopicStatus("foo", CONNECTOR_NAME, 0, 0L);
+ TopicStatus barStatus = new TopicStatus("bar", CONNECTOR_NAME, 0, 0L);
+
when(statusBackingStore.getAllTopics(CONNECTOR_NAME)).thenReturn(Set.of(fooStatus,
barStatus));
+
FutureCallback<Herder.Created<ConnectorInfo>> deleteCallback = new
FutureCallback<>();
expectDestroy();
herder.deleteConnectorConfig(CONNECTOR_NAME, deleteCallback);
verify(herder).onDeletion(CONNECTOR_NAME);
verify(statusBackingStore).put(new TaskStatus(new
ConnectorTaskId(CONNECTOR_NAME, 0), TaskStatus.State.DESTROYED, WORKER_ID, 0));
verify(statusBackingStore).put(new ConnectorStatus(CONNECTOR_NAME,
ConnectorStatus.State.DESTROYED, WORKER_ID, 0));
+ verify(statusBackingStore).deleteTopic(CONNECTOR_NAME, "foo");
Review Comment:
Thank you for pointing this out.
I agree that the existing test doesn't directly cover the recreation
scenario.
I've added an integration test in `StandaloneWorkerIntegrationTest` to cover
this use case.
Could you please take another look?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]