diff options
author | Paul Duffin <paulduffin@google.com> | 2017-03-27 13:37:29 +0100 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2017-03-27 16:28:03 +0100 |
commit | bdbf4228eb7fdfffdde3dffe81f6b53fca44cd02 (patch) | |
tree | e35cc0246f61e032301f32b4179cabd4b143a44f | |
parent | e31ef130820979e9a5487299ad4486291d840272 (diff) |
Remove dependency on org.mockito.compat.ArgumentMatcher class
Bug: 32912773
Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: If15f6fb7bb2b1a4e3593509d0aca5a598d536f3b
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WificondControlTest.java | 22 |
1 files changed, 15 insertions, 7 deletions
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<SingleScanSettings> { + private class ScanMatcher implements ArgumentMatcher<SingleScanSettings> { private final Set<Integer> mExpectedFreqs; private final Set<String> mExpectedSsids; ScanMatcher(Set<Integer> expectedFreqs, Set<String> 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> channelSettings = settings.channelSettings; ArrayList<HiddenNetwork> 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<PnoSettings> { + private class PnoScanMatcher implements ArgumentMatcher<PnoSettings> { 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 + '}'; + } } } |