summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2021-03-21 01:50:08 +0900
committerLorenzo Colitti <lorenzo@google.com>2021-03-21 01:54:51 +0900
commit250710c6879ea3b2fbd33ab67f81081a5d878e0c (patch)
tree412f914a621d73683f0a7da750410475ebe8d811 /tests
parent3b0736735b4a7df99647b84862232971d12a5e84 (diff)
Cherry-pick some test changes from ag/13210542.
ag/13210542 switched from using reset() on mResources to using clearInvocations(). This ensures that only the previous calls are reset, and that the mock continues to behave according to what was specified in setUp. Test: 183097033 Test: test-only change Merged-In: I35d28c8df341dbbac2774026c6ca749e296c0482 Change-Id: Ieef982d2df50db3014f35f58a77674939ebe0d43
Diffstat (limited to 'tests')
-rw-r--r--tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java b/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java
index ff8c632833f2..2adde7400d3c 100644
--- a/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java
+++ b/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java
@@ -20,6 +20,7 @@ import static com.android.server.connectivity.NetworkNotificationManager.Notific
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyInt;
+import static org.mockito.Mockito.clearInvocations;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
@@ -142,15 +143,15 @@ public class NetworkNotificationManagerTest {
public void testTitleOfPrivateDnsBroken() {
// Test the title of mobile data.
verifyTitleByNetwork(100, mCellNai, R.string.mobile_no_internet);
- reset(mResources);
+ clearInvocations(mResources);
// Test the title of wifi.
verifyTitleByNetwork(101, mWifiNai, R.string.wifi_no_internet);
- reset(mResources);
+ clearInvocations(mResources);
// Test the title of other networks.
verifyTitleByNetwork(102, mVpnNai, R.string.other_networks_no_internet);
- reset(mResources);
+ clearInvocations(mResources);
}
@Test