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


##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/TaskManagerTest.java:
##########
@@ -1740,13 +1740,14 @@ public void 
shouldComputeOffsetSumFromCheckpointFileForUninitializedTask() throw
         taskManager.handleRebalanceStart(singleton("topic"));
         final StateMachineTask uninitializedTask = new 
StateMachineTask(taskId00, taskId00Partitions, true);
         expect(activeTaskCreator.createTasks(anyObject(), 
eq(taskId00Assignment))).andStubReturn(singleton(uninitializedTask));
-        
expect(standbyTaskCreator.createTasks(anyObject())).andStubReturn(Collections.emptySet());
-        replay(activeTaskCreator, standbyTaskCreator);
+        replay(activeTaskCreator);
         taskManager.handleAssignment(taskId00Assignment, emptyMap());
 
         assertThat(uninitializedTask.state(), is(State.CREATED));
 
         assertThat(taskManager.getTaskOffsetSums(), is(expectedOffsetSums));
+
+        Mockito.verify(standbyTaskCreator).createTasks(Collections.emptyMap());

Review Comment:
   To be honest, here I followed what was done in PR 
https://github.com/apache/kafka/pull/13681
   For example, the original in the mentioned PR was.
   ```
   ...
   expect(activeTaskCreator.createTasks(consumer, 
Collections.emptyMap())).andReturn(emptySet());
   ...
   ```
   
(https://github.com/apache/kafka/pull/13681/files#diff-48bc1476f0437fd711093c7c80ce73eda10be0511705799b4248545c203d521dL294)
   
   
   and with Mockito we changed it to
   ```
   ...
   Mockito.verify(activeTaskCreator).createTasks(consumer, 
Collections.emptyMap());
   ...
   ```
   
(https://github.com/apache/kafka/pull/13681/files#diff-48bc1476f0437fd711093c7c80ce73eda10be0511705799b4248545c203d521dR306)
   
   I followed the same logic for what I thought was a stronger verification, 
but I am happy to remove it if you think it is unnecessary. I realise the 
reasoning for doing the above in that PR might have made more sense because 
there was more than one argument.
   
   Let me know!



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