Rename satisfiedBy to canBeSatisfiedBy for MatchAllNetworkSpecifier

MatchAllNetworkSpecifier is a subclass of NetworkSpecifer. The method
satisfiedBy should be renamed to canBeSatisfiedBy together with other
subclass of NetworkSpecifer in b/152238712.

Add annotation @Overide for the method to make sure it will not get
ignored when refactor in the future.

Bug: 154956584
Test: atest android.net.MatchAllNetworkSpecifierTest
Change-Id: Ibe32fd50fae43aa635c1c0dad66eaea82011c8b7
This commit is contained in:
Rambo Wang
2020-04-24 16:37:16 -07:00
parent c44ca579ad
commit f3508769ea

View File

@@ -39,12 +39,12 @@ class MatchAllNetworkSpecifierTest {
} }
@Test(expected = IllegalStateException::class) @Test(expected = IllegalStateException::class)
fun testSatisfiedBy() { fun testCanBeSatisfiedBy() {
val specifier = MatchAllNetworkSpecifier() val specifier = MatchAllNetworkSpecifier()
val discoverySession = Mockito.mock(DiscoverySession::class.java) val discoverySession = Mockito.mock(DiscoverySession::class.java)
val peerHandle = Mockito.mock(PeerHandle::class.java) val peerHandle = Mockito.mock(PeerHandle::class.java)
val wifiAwareNetworkSpecifier = WifiAwareNetworkSpecifier.Builder(discoverySession, val wifiAwareNetworkSpecifier = WifiAwareNetworkSpecifier.Builder(discoverySession,
peerHandle).build() peerHandle).build()
specifier.satisfiedBy(wifiAwareNetworkSpecifier) specifier.canBeSatisfiedBy(wifiAwareNetworkSpecifier)
} }
} }