hgeraldino commented on code in PR #14663: URL: https://github.com/apache/kafka/pull/14663#discussion_r1477107060
########## connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerSinkTaskTest.java: ########## @@ -1994,53 +1616,6 @@ private void expectInitializeTask() { PowerMock.expectLastCall(); } - private void expectRebalanceLossError(RuntimeException e) { - sinkTask.close(new HashSet<>(INITIAL_ASSIGNMENT)); - EasyMock.expectLastCall().andThrow(e); - - EasyMock.expect(consumer.poll(Duration.ofMillis(EasyMock.anyLong()))).andAnswer( - () -> { - rebalanceListener.getValue().onPartitionsLost(INITIAL_ASSIGNMENT); - return ConsumerRecords.empty(); - }); - } - - private void expectRebalanceRevocationError(RuntimeException e) { - sinkTask.close(new HashSet<>(INITIAL_ASSIGNMENT)); - EasyMock.expectLastCall().andThrow(e); - - sinkTask.preCommit(EasyMock.anyObject()); - EasyMock.expectLastCall().andReturn(Collections.emptyMap()); - - EasyMock.expect(consumer.poll(Duration.ofMillis(EasyMock.anyLong()))).andAnswer( - () -> { - rebalanceListener.getValue().onPartitionsRevoked(INITIAL_ASSIGNMENT); - return ConsumerRecords.empty(); - }); - } - - private void expectRebalanceAssignmentError(RuntimeException e) { - sinkTask.close(INITIAL_ASSIGNMENT); - EasyMock.expectLastCall(); - - sinkTask.preCommit(EasyMock.anyObject()); - EasyMock.expectLastCall().andReturn(Collections.emptyMap()); - - EasyMock.expect(consumer.position(TOPIC_PARTITION)).andReturn(FIRST_OFFSET); - EasyMock.expect(consumer.position(TOPIC_PARTITION2)).andReturn(FIRST_OFFSET); - - sinkTask.open(INITIAL_ASSIGNMENT); - EasyMock.expectLastCall().andThrow(e); - - EasyMock.expect(consumer.assignment()).andReturn(INITIAL_ASSIGNMENT).times(2); - EasyMock.expect(consumer.poll(Duration.ofMillis(EasyMock.anyLong()))).andAnswer( - () -> { - rebalanceListener.getValue().onPartitionsRevoked(INITIAL_ASSIGNMENT); - rebalanceListener.getValue().onPartitionsAssigned(INITIAL_ASSIGNMENT); - return ConsumerRecords.empty(); - }); - } - private void expectPollInitialAssignment() { Review Comment: removed -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org