C0urante commented on code in PR #12735: URL: https://github.com/apache/kafka/pull/12735#discussion_r1009729516
########## connect/runtime/src/test/java/org/apache/kafka/connect/runtime/ErrorHandlingTaskTest.java: ########## @@ -374,30 +350,40 @@ public void testErrorHandlingInSourceTasks() throws Exception { Struct struct2 = new Struct(valSchema).put("val", 6789); SourceRecord record2 = new SourceRecord(emptyMap(), emptyMap(), TOPIC, PARTITION1, valSchema, struct2); - EasyMock.expect(workerSourceTask.isStopping()).andReturn(false); - EasyMock.expect(workerSourceTask.isStopping()).andReturn(false); - EasyMock.expect(workerSourceTask.isStopping()).andReturn(true); + when(workerSourceTask.isStopping()) + .thenReturn(false) + .thenReturn(false) + .thenReturn(true); - EasyMock.expect(workerSourceTask.commitOffsets()).andReturn(true); + doReturn(true).when(workerSourceTask).commitOffsets(); - offsetStore.start(); - EasyMock.expectLastCall(); - sourceTask.initialize(EasyMock.anyObject()); - EasyMock.expectLastCall(); - sourceTask.start(EasyMock.anyObject()); - EasyMock.expectLastCall(); + when(sourceTask.poll()) + .thenReturn(singletonList(record1)) + .thenReturn(singletonList(record2)); - EasyMock.expect(sourceTask.poll()).andReturn(singletonList(record1)); - EasyMock.expect(sourceTask.poll()).andReturn(singletonList(record2)); expectTopicCreation(TOPIC); Review Comment: Ah, good catch! We can leave this as-is, as long as the parameterized test logic is fixed (since right now topic creation is disabled for every test and this method is essentially a no-op). -- 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