Merge "Fix TetheringTest.failureEnablingIpForwarding verification count" into main am: 856f57a0ce
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3543699
Change-Id: I5190535fb862b09de0aac12ed1befdee2a51c449
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java b/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java
index 2a22c6d..fe3b201 100644
--- a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java
+++ b/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java
@@ -2030,7 +2030,7 @@
@Test
public void failureEnablingIpForwarding() throws Exception {
initTetheringOnTestThread();
- when(mWifiManager.startTetheredHotspot(any(SoftApConfiguration.class))).thenReturn(true);
+ when(mWifiManager.startTetheredHotspot(null)).thenReturn(true);
doThrow(new RemoteException()).when(mNetd).ipfwdEnableForwarding(TETHERING_NAME);
// Emulate pressing the WiFi tethering button.
@@ -2080,9 +2080,9 @@
TEST_WLAN_IFNAME, WifiManager.IFACE_IP_MODE_CONFIGURATION_ERROR);
verify(mTetheringMetrics, times(0)).maybeUpdateUpstreamType(any());
- verify(mTetheringMetrics, times(2)).updateErrorCode(eq(TETHERING_WIFI),
+ verify(mTetheringMetrics, times(1)).updateErrorCode(eq(TETHERING_WIFI),
eq(TETHER_ERROR_INTERNAL_ERROR));
- verify(mTetheringMetrics, times(2)).sendReport(eq(TETHERING_WIFI));
+ verify(mTetheringMetrics, times(1)).sendReport(eq(TETHERING_WIFI));
verifyNoMoreInteractions(mWifiManager);
verifyNoMoreInteractions(mNetd);