Update test on calling getAppExclusionList with restricted user
Bug: 247344442 Test: atest VpnTest Change-Id: I3b847f13162f8702013b23cabefce8d98b62f5c6
This commit is contained in:
@@ -944,12 +944,15 @@ public class VpnTest extends VpnTestBase {
|
||||
@Test
|
||||
public void testSetAndGetAppExclusionListRestrictedUser() throws Exception {
|
||||
final Vpn vpn = prepareVpnForVerifyAppExclusionList();
|
||||
|
||||
// Mock it to restricted profile
|
||||
when(mUserManager.getUserInfo(anyInt())).thenReturn(RESTRICTED_PROFILE_A);
|
||||
|
||||
// Restricted users cannot configure VPNs
|
||||
assertThrows(SecurityException.class,
|
||||
() -> vpn.setAppExclusionList(TEST_VPN_PKG, new ArrayList<>()));
|
||||
assertThrows(SecurityException.class, () -> vpn.getAppExclusionList(TEST_VPN_PKG));
|
||||
|
||||
assertEquals(Arrays.asList(PKGS), vpn.getAppExclusionList(TEST_VPN_PKG));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user