summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2017-03-27 13:37:29 +0100
committerPaul Duffin <paulduffin@google.com>2017-03-28 10:48:45 +0100
commit730ccbfc0c291c37265fc0abe67e55f831a9fe38 (patch)
treefb1c158180c0974344d277204b48345a40077110 /tests
parentbb2fdf553e6580923e1dc3e6ac90ca777c5d7226 (diff)
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
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 + '}';
+ }
}
}