Github user tzulitai commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5284#discussion_r161160136
  
    --- Diff: 
flink-connectors/flink-connector-kafka-base/src/test/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumerBaseTest.java
 ---
    @@ -265,10 +274,8 @@ public void 
testSnapshotStateWithCommitOnCheckpointsEnabled() throws Exception {
     
                // 
--------------------------------------------------------------------
     
    -           final OneShotLatch runLatch = new OneShotLatch();
    -           final OneShotLatch stopLatch = new OneShotLatch();
    -           final AbstractFetcher<String, ?> fetcher = 
getRunnableMockFetcher(runLatch, stopLatch);
    -           when(fetcher.snapshotCurrentState()).thenReturn(state1, state2, 
state3);
    +           final MockFetcher<String> fetcher = spy(new MockFetcher<>());
    +           
doReturn(state1).doReturn(state2).doReturn(state3).when(fetcher).snapshotCurrentState();
    --- End diff --
    
    Yes, if we really want to get rid of Mockito for good :) 
    
    Though `checkState(!stateSnapshotsToReturn.isEmpty())` is a bit 
problematic, because the unit tests rely on the last return stub to re-occur 
for all remaining calls.
    
    I'll change this while merging.


---

Reply via email to