clolov commented on code in PR #13874:
URL: https://github.com/apache/kafka/pull/13874#discussion_r1241854735
##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/TaskManagerTest.java:
##########
@@ -4463,21 +4449,18 @@ public void suspend() {
@Test
public void shouldConvertActiveTaskToStandbyTask() {
- final StreamTask activeTask = EasyMock.mock(StreamTask.class);
- expect(activeTask.id()).andStubReturn(taskId00);
- expect(activeTask.inputPartitions()).andStubReturn(taskId00Partitions);
- expect(activeTask.isActive()).andStubReturn(true);
-
expect(activeTask.prepareCommit()).andStubReturn(Collections.emptyMap());
+ final StreamTask activeTask = Mockito.mock(StreamTask.class);
+ when(activeTask.id()).thenReturn(taskId00);
+ when(activeTask.inputPartitions()).thenReturn(taskId00Partitions);
+ when(activeTask.isActive()).thenReturn(true);
- final StandbyTask standbyTask = EasyMock.mock(StandbyTask.class);
- expect(standbyTask.id()).andStubReturn(taskId00);
+ final StandbyTask standbyTask = Mockito.mock(StandbyTask.class);
+ when(standbyTask.id()).thenReturn(taskId00);
when(activeTaskCreator.createTasks(any(),
Mockito.eq(taskId00Assignment))).thenReturn(singletonList(activeTask));
- activeTask.prepareRecycle();
Review Comment:
The reason for this is that the method in which `prepareRecycle` is used is
the mocked `createStandbyTaskFromActive` of `standbyTaskCreator`. Let me know
in case I am wrong
--
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]