From 730ccbfc0c291c37265fc0abe67e55f831a9fe38 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Mon, 27 Mar 2017 13:37:29 +0100 Subject: Remove dependency on org.mockito.compat.ArgumentMatcher class Bug: 32912773 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh (cherry picked from commit bdbf4228eb7fdfffdde3dffe81f6b53fca44cd02) Change-Id: I3ad3c48d4569019a2cdd9d52994e85be6b8d2272 --- .../android/server/wifi/WificondControlTest.java | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/wifitests/src/com/android/server/wifi/WificondControlTest.java b/tests/wifitests/src/com/android/server/wifi/WificondControlTest.java index d7c628e01..6d26c9b39 100644 --- a/tests/wifitests/src/com/android/server/wifi/WificondControlTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WificondControlTest.java @@ -46,7 +46,7 @@ import com.android.server.wifi.wificond.SingleScanSettings; import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; -import org.mockito.compat.ArgumentMatcher; +import org.mockito.ArgumentMatcher; import java.util.ArrayList; import java.util.BitSet; @@ -630,7 +630,7 @@ public class WificondControlTest { // Create a ArgumentMatcher which captures a SingleScanSettings parameter and checks if it // matches the provided frequency set and ssid set. - private class ScanMatcher extends ArgumentMatcher { + private class ScanMatcher implements ArgumentMatcher { private final Set mExpectedFreqs; private final Set mExpectedSsids; ScanMatcher(Set expectedFreqs, Set expectedSsids) { @@ -639,8 +639,7 @@ public class WificondControlTest { } @Override - public boolean matchesObject(Object argument) { - SingleScanSettings settings = (SingleScanSettings) argument; + public boolean matches(SingleScanSettings settings) { ArrayList channelSettings = settings.channelSettings; ArrayList hiddenNetworks = settings.hiddenNetworks; if (mExpectedFreqs != null) { @@ -674,18 +673,23 @@ public class WificondControlTest { } return true; } + + @Override + public String toString() { + return "ScanMatcher{mExpectedFreqs=" + mExpectedFreqs + + ", mExpectedSsids=" + mExpectedSsids + '}'; + } } // Create a ArgumentMatcher which captures a PnoSettings parameter and checks if it // matches the WifiNative.PnoSettings; - private class PnoScanMatcher extends ArgumentMatcher { + private class PnoScanMatcher implements ArgumentMatcher { private final WifiNative.PnoSettings mExpectedPnoSettings; PnoScanMatcher(WifiNative.PnoSettings expectedPnoSettings) { this.mExpectedPnoSettings = expectedPnoSettings; } @Override - public boolean matchesObject(Object argument) { - PnoSettings settings = (PnoSettings) argument; + public boolean matches(PnoSettings settings) { if (mExpectedPnoSettings == null) { return false; } @@ -716,5 +720,9 @@ public class WificondControlTest { return true; } + @Override + public String toString() { + return "PnoScanMatcher{" + "mExpectedPnoSettings=" + mExpectedPnoSettings + '}'; + } } } -- cgit v1.2.3