diff options
author | Sohani Rao <sohanirao@google.com> | 2017-03-27 17:29:28 -0700 |
---|---|---|
committer | Sohani Rao <sohanirao@google.com> | 2017-03-30 17:09:40 -0700 |
commit | 2078ffdef94c81f7808b56b87e8087bead8a2e09 (patch) | |
tree | 1cab9ce515adb07d557c33c3a0aafe49faf1e39b /tests | |
parent | 6236c87501a724cdb4e727b1631ee11db106460c (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.java | 7 |
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()); } } |