C0urante commented on code in PR #12307:
URL: https://github.com/apache/kafka/pull/12307#discussion_r901125618
##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerConnectorTest.java:
##########
@@ -142,11 +174,13 @@ public void testFailureIsFinalState() {
ctx.close();
expectLastCall();
- offsetStorageReader.close();
- expectLastCall();
+ if (connectorType == ConnectorType.SOURCE) {
+ offsetStorageReader.close();
+ expectLastCall();
- offsetStore.stop();
- expectLastCall();
+ offsetStore.stop();
+ expectLastCall();
+ }
Review Comment:
I don't see this as significantly different than a lot of the other repeated
sections in the test, such as the [expectations for clean startup of a
non-paused
connector](https://github.com/apache/kafka/blob/cfdd567955588e134770a9145ba57800ca88313c/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerConnectorTest.java#L173-L183).
While it might be nice to fold some of these sections into reusable methods,
the changes here don't make this repetition any worse than it already is, and
I'm worried that decomposing them might complicate the Mockito transition that
@clolov has mentioned.
--
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]