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


##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/TaskManagerTest.java:
##########
@@ -2469,19 +2416,18 @@ public void 
shouldCloseStandbyUnassignedTasksWhenCreatingNewTasks() {
         assertThat(task00.state(), is(Task.State.CLOSED));
         assertThat(taskManager.activeTaskMap(), Matchers.anEmptyMap());
         assertThat(taskManager.standbyTaskMap(), Matchers.anEmptyMap());
+        verifyResumeWasCalled(consumer);

Review Comment:
   I will answer here, but the answer applies to all the other places you have 
asked it as well.
   The original code for `expectRestoreToBeCompleted` was:
   ```
   private static void expectRestoreToBeCompleted(final Consumer<byte[], 
byte[]> consumer) {
           final Set<TopicPartition> assignment = singleton(new 
TopicPartition("assignment", 0));
           expect(consumer.assignment()).andReturn(assignment);
           consumer.resume(assignment);
           expectLastCall();
   }
   ```
   This should in theory be changed to
   ```
   private static void expectRestoreToBeCompleted(final Consumer<byte[], 
byte[]> consumer) {
           final Set<TopicPartition> assignment = singleton(new 
TopicPartition("assignment", 0));
           when(consumer.assignment()).thenReturn(assignment);
           Mockito.verify(consumer).resume(assignment);
   }
   ```
   However, if we have the verify there it will fail as it needs to be verified 
after the object/method under test is exercised. Hence I moved it to a separate 
function and added it as a verification at the end of the test.



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