@Test
public void testOverridedPermissions1() throws Exception {

    // deploy a new atomic permission and a new compound permission
    deployContrib(CoreUTConstants.CORE_TESTS_BUNDLE,
            "permissions-override1-contrib.xml");
    PermissionProvider pp = service.getPermissionProvider();
    // test how previous permissions where affected by the override
    String[] groups = pp.getPermissionGroups("Read");
    assertNotNull(groups);
    assertEquals(
            Arrays.asList("CustomCompoundPerm", "ReadRemove", "ReadWrite"),
            Arrays.asList(groups));
    groups = pp.getPermissionGroups("ReadProperties");
    assertNotNull(groups);
    assertEquals(Arrays.asList("CustomCompoundPerm", "Read", "ReadRemove",
            "ReadWrite"), Arrays.asList(groups));
    groups = pp.getPermissionGroups("ReadChildren");
    assertNotNull(groups);
    assertEquals(Arrays.asList("CustomCompoundPerm", "Read", "ReadRemove",
            "ReadWrite"), Arrays.asList(groups));
    groups = pp.getPermissionGroups("Browse");
    assertNotNull(groups);
    assertEquals(Arrays.asList("CustomCompoundPerm", "Read",
            "ReadProperties", "ReadRemove", "ReadWrite"),
            Arrays.asList(groups));
    // test the new permissions
    groups = pp.getPermissionGroups("CustomCompoundPerm");
    assertNull(groups);
    groups = pp.getPermissionGroups("CustomAtomicPerm");
    assertNotNull(groups);
    assertEquals(Arrays.asList("CustomCompoundPerm"), Arrays.asList(groups));
}