@Test
public void testGetResourceAccessWithGroups() {

    final String domainName = "access-domain";
    ZTSTestUtils.setupDomainsWithGroups(store, privateKey, domainName, Collections.emptyList());
    // user1 and user3 have access to UPDATE/resource1
    Principal principal = SimplePrincipal.create("user", "user1",
            "v=U1;d=user;n=user1;s=signature", 0, null);
    ResourceContext context = createResourceContext(principal);
    // user1 and user3 have access to UPDATE/resource1
    ResourceAccess access = zts.getResourceAccess(context, "update", domainName + "1:resource1", null, null);
    assertTrue(access.getGranted());
    access = zts.getResourceAccess(context, "update", domainName + "1:resource2", null, null);
    assertTrue(access.getGranted());
    access = zts.getResourceAccess(context, "update", domainName + "1:resource3", null, null);
    assertFalse(access.getGranted());
    access = zts.getResourceAccess(context, "update", domainName + "1:resource4", null, null);
    assertFalse(access.getGranted());
}