clolov commented on code in PR #15261:
URL: https://github.com/apache/kafka/pull/15261#discussion_r1481555805


##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/TaskManagerTest.java:
##########
@@ -4821,8 +4911,10 @@ private Map<TaskId, StateMachineTask> 
handleAssignment(final Map<TaskId, Set<Top
         
when(standbyTaskCreator.createTasks(standbyAssignment)).thenReturn(standbyTasks);
         when(activeTaskCreator.createTasks(any(), 
Mockito.eq(allActiveTasksAssignment))).thenReturn(allActiveTasks);
 
-        expectRestoreToBeCompleted(consumer);
-        replay(consumer);
+        final Set<TopicPartition> assignment = singleton(new 
TopicPartition("assignment", 0));
+        lenient().when(mockitoConsumer.assignment()).thenReturn(assignment);
+
+        taskManager.setMainConsumer(mockitoConsumer);

Review Comment:
   I can try to completely get rid of the `consumer` in this pull request. I 
wanted to minimise the changes needed to review this change (fix all tests 
which relied on `expectRestoreToBeCompleted`). I was imagining one more pull 
request after this one is merged which gets rid of the the remaining usage of 
`consumer` and moves this into the setup. If you want to see all changes in 
this pull request I can try to achieve them in a subsequent commit.



-- 
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

Reply via email to