You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by pn...@apache.org on 2019/07/01 14:41:15 UTC

[flink] 06/16: [hotfix][test] Drop mockito usage from BarrierTrackerTest

This is an automated email from the ASF dual-hosted git repository.

pnowojski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 814f47e8b6b5ac9c8ba606ae901ded92da8174d2
Author: Piotr Nowojski <pi...@gmail.com>
AuthorDate: Fri Jun 14 18:02:28 2019 +0200

    [hotfix][test] Drop mockito usage from BarrierTrackerTest
---
 .../flink/streaming/runtime/io/BarrierTrackerTest.java     | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/BarrierTrackerTest.java b/flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/BarrierTrackerTest.java
index 1be2aab..a8e7727 100644
--- a/flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/BarrierTrackerTest.java
+++ b/flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/BarrierTrackerTest.java
@@ -37,11 +37,7 @@ import java.util.Arrays;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
+
 
 /**
  * Tests for the behavior of the barrier tracker.
@@ -355,17 +351,15 @@ public class BarrierTrackerTest {
 			createCancellationBarrier(2L, 2),
 			createBuffer(0)
 		};
-		AbstractInvokable statefulTask = mock(AbstractInvokable.class);
-		tracker = createBarrierTracker(3, sequence, statefulTask);
+		CheckpointSequenceValidator validator =
+			new CheckpointSequenceValidator(-1, -2);
+		tracker = createBarrierTracker(3, sequence, validator);
 
 		for (BufferOrEvent boe : sequence) {
 			if (boe.isBuffer() || (boe.getEvent().getClass() != CheckpointBarrier.class && boe.getEvent().getClass() != CancelCheckpointMarker.class)) {
 				assertEquals(boe, tracker.pollNext().get());
 			}
 		}
-
-		verify(statefulTask, times(1)).abortCheckpointOnBarrier(eq(1L), any(Throwable.class));
-		verify(statefulTask, times(1)).abortCheckpointOnBarrier(eq(2L), any(Throwable.class));
 	}
 
 	// ------------------------------------------------------------------------