From 51e3e8992dfd28daeb2ed23a89fe7997ef083ed3 Mon Sep 17 00:00:00 2001 From: Mattia Iavarone Date: Thu, 4 Jul 2019 21:32:52 -0500 Subject: [PATCH] Fix zoom test --- .../otaliastudios/cameraview/CameraViewCallbacksTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraViewCallbacksTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraViewCallbacksTest.java index f5276263..bd461ef0 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraViewCallbacksTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraViewCallbacksTest.java @@ -36,6 +36,7 @@ import org.mockito.stubbing.Stubber; import static junit.framework.Assert.assertNotNull; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; +import static org.mockito.ArgumentMatchers.nullable; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyFloat; import static org.mockito.Matchers.anyInt; @@ -175,11 +176,11 @@ public class CameraViewCallbacksTest extends BaseTest { @Test public void testDispatchOnZoomChanged() { - completeTask().when(listener).onZoomChanged(anyFloat(), any(float[].class), any(PointF[].class)); + completeTask().when(listener).onZoomChanged(eq(0f), eq(new float[]{0, 1}), nullable(PointF[].class)); camera.mCameraCallbacks.dispatchOnZoomChanged(0f, null); assertNotNull(op.await(500)); - verify(listener, times(1)).onZoomChanged(anyFloat(), any(float[].class), any(PointF[].class)); + verify(listener, times(1)).onZoomChanged(eq(0f), eq(new float[]{0, 1}), nullable(PointF[].class)); } @Test