summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2017-03-30 06:20:51 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-03-30 06:20:51 +0000
commit3108e4b84d64353b6a055655af92271c98ad267e (patch)
tree55af15cfbe5539a833f02916390e7b62a9780fbe /tests
parentfab2bc6d0df6f2523d0b8a5ecfebaf1ee936bcee (diff)
parent730ccbfc0c291c37265fc0abe67e55f831a9fe38 (diff)
Merge "Remove dependency on org.mockito.compat.ArgumentMatcher class" into oc-dev
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WificondControlTest.java22
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 + '}';
+ }
}
}