summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSohani Rao <sohanirao@google.com>2017-03-27 17:29:28 -0700
committerSohani Rao <sohanirao@google.com>2017-03-28 12:33:01 -0700
commit30a29085c09339ff9faf12f105da6f80ffb77389 (patch)
tree9720e04a8f1d2099bd4455e877568a85690fcfc6 /tests
parent32575fa7a506bf05edb20a37e59d42af981a0a13 (diff)
Make WifiStateTrackerTest work with Mockito2.0
Replace anyString() with any() in order to get the test passing Bug: 36659003 Test: Unit test for WifiStateTracker Change-Id: Id35bab32591a72df3de18b6d771971f8981029b2
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiStateTrackerTest.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiStateTrackerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiStateTrackerTest.java
index 1f2af10ab..b6c8b8d5c 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiStateTrackerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiStateTrackerTest.java
@@ -18,8 +18,8 @@ package com.android.server.wifi;
import com.android.internal.app.IBatteryStats;
+import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyInt;
-import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -53,7 +53,6 @@ public class WifiStateTrackerTest {
* Ensure BatteryStats's noteWifiState() is called when the method
* updateState() is invoked on WifiStateTracker for relevant states.
*/
- @DisabledForUpdateToAnyMatcher
@Test
public void testBatteryStatsUpdated() throws Exception {
int[] relevantStates = new int[] { WifiStateTracker.SCAN_MODE,
@@ -62,7 +61,7 @@ public class WifiStateTrackerTest {
for (int i = 0; i < relevantStates.length; i++) {
mWifiStateTracker.updateState(relevantStates[i]);
}
- verify(mBatteryStats, times(relevantStates.length)).noteWifiState(anyInt(), anyString());
+ verify(mBatteryStats, times(relevantStates.length)).noteWifiState(anyInt(), any());
}
/**
@@ -76,6 +75,6 @@ public class WifiStateTrackerTest {
for (int i = 0; i < irrelevantStates.length; i++) {
mWifiStateTracker.updateState(irrelevantStates[i]);
}
- verify(mBatteryStats, times(0)).noteWifiState(anyInt(), anyString());
+ verify(mBatteryStats, times(0)).noteWifiState(anyInt(), any());
}
}