Validate cellular network in testSetAvoidUnvalidated() for accurate testing
* Modified testSetAvoidUnvalidated() to ensure the cellular network is
validated before proceeding with default network switching tests.
* This prevents inaccurate test results when the cellular network is not
usable, as the connectivity service won't switch to it if the Wi-Fi
network becomes invalid.
Bug: 371818866
Test: TH
Change-Id: I458903392605a44470d5f226a36cfa983ec71aea
diff --git a/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java b/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java
index b62db04..0e9ea0c 100644
--- a/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java
+++ b/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java
@@ -3061,6 +3061,7 @@
try {
final Network cellNetwork = networkCallbackRule.requestCell();
+ ensureCellIsValidatedBeforeMockingValidationUrls();
final Network wifiNetwork = prepareValidatedNetwork();
final TestableNetworkCallback defaultCb =