ethernet: cleanup updateConfiguration tests
Unfortunately, TestableNetworkCallback.expectCapabilitiesWith cannot be
used as it expects to be passed a HasNetwork object.
Test: atest EthernetManagerTest
Change-Id: I0b88bc8b51711db4464608a5075dec32a1fc8ef7
diff --git a/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt b/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt
index 228ad13..8909e1a 100644
--- a/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt
+++ b/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt
@@ -532,7 +532,7 @@
it.networkSpecifier == EthernetNetworkSpecifier(name)
}
- private fun TestableNetworkCallback.expectCapabilitiesWithCapability(cap: Int) =
+ private fun TestableNetworkCallback.expectCapabilitiesWith(cap: Int) =
expectCapabilitiesThat(anyNetwork(), TIMEOUT_MS) {
it.hasCapability(cap)
}
@@ -877,14 +877,14 @@
// will be expected first before available, as part of the restart.
cb.expectLost(network)
cb.expectAvailable()
- cb.expectCapabilitiesWithCapability(testCapability)
+ cb.expectCapabilitiesWith(testCapability)
cb.expectLinkPropertiesWithLinkAddress(
STATIC_IP_CONFIGURATION.staticIpConfiguration.ipAddress!!)
}
@Test
fun testUpdateConfiguration_forOnlyIpConfig() {
- val iface: EthernetTestInterface = createInterface()
+ val iface = createInterface()
val cb = requestNetwork(ETH_REQUEST.createCopyWithEthernetSpecifier(iface.name))
val network = cb.expectAvailable()
cb.assertNeverLost()
@@ -905,7 +905,7 @@
@Ignore
@Test
fun testUpdateConfiguration_forOnlyCapabilities() {
- val iface: EthernetTestInterface = createInterface()
+ val iface = createInterface()
val cb = requestNetwork(ETH_REQUEST.createCopyWithEthernetSpecifier(iface.name))
val network = cb.expectAvailable()
cb.assertNeverLost()
@@ -921,6 +921,6 @@
// will be expected first before available, as part of the restart.
cb.expectLost(network)
cb.expectAvailable()
- cb.expectCapabilitiesWithCapability(testCapability)
+ cb.expectCapabilitiesWith(testCapability)
}
}