Unit test TelephonySubscriptionSnapshot changes for VCNs.

This CL adds unit testing for TelephonySubscriptionSnapshot updates in
UnderlyingNetworkTracker, Vcn, and VcnManagementService.

Bug: 177364490
Test: atest FrameworksVcnTests
Change-Id: I244744194a1360c7c7dee062a302e04f9b5efc32
This commit is contained in:
Cody Kesting
2021-01-22 09:59:07 -08:00
parent 2b0754517c
commit 50e9bf04aa
6 changed files with 241 additions and 35 deletions

View File

@@ -598,4 +598,16 @@ public class VcnManagementServiceTest {
mVcnMgmtSvc.getUnderlyingNetworkPolicy(new NetworkCapabilities(), new LinkProperties());
}
@Test
public void testSubscriptionSnapshotUpdateNotifiesVcn() {
mVcnMgmtSvc.setVcnConfig(TEST_UUID_2, TEST_VCN_CONFIG, TEST_PACKAGE_NAME);
final Map<ParcelUuid, Vcn> vcnInstances = mVcnMgmtSvc.getAllVcns();
final Vcn vcnInstance = vcnInstances.get(TEST_UUID_2);
TelephonySubscriptionSnapshot snapshot =
triggerSubscriptionTrackerCbAndGetSnapshot(Collections.singleton(TEST_UUID_2));
verify(vcnInstance).updateSubscriptionSnapshot(eq(snapshot));
}
}