chia7712 commented on code in PR #14716:
URL: https://github.com/apache/kafka/pull/14716#discussion_r1584442796


##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamTaskTest.java:
##########
@@ -411,25 +394,32 @@ public void seek(final TopicPartition partition, final 
long offset) {
 
         shouldNotSeek.set(new AssertionError("Should not seek"));
 
+        @SuppressWarnings("unchecked")
         final java.util.function.Consumer<Set<TopicPartition>> resetter =
-            EasyMock.mock(java.util.function.Consumer.class);
-        resetter.accept(Collections.singleton(partition1));
-        EasyMock.expectLastCall();
-        EasyMock.replay(resetter);
+            mock(java.util.function.Consumer.class);

Review Comment:
   we can just pass lambda function to `task.completeRestoration`. For example:
   ```java
           // We need to keep a separate reference to the arguments of 
Consumer#accept
           // because the underlying data-structure is emptied and on 
verification time
           // it is reported as empty.
           final Set<TopicPartition> partitionsAtCall = new HashSet<>();
   
           task.initializeIfNeeded();
           task.completeRestoration(partitionsAtCall::addAll);
   ```



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