@Test
public void testGetShortResource() {

    final String DATA = "we wish you a merry xmas and a happy new year";
    UserGroup g1 = createUserGroup("g1xyz");
    createUser("u1", Role.USER, "u1", g1);
    createUser("u2", Role.USER, "u2", g1);
    createDefaultCategory();
    RESTResource r1 = buildResource("r1", DEFAULTCATEGORYNAME);
    GeoStoreClient c1 = createClient("u1", "u1");
    GeoStoreClient c2 = createClient("u2", "u2");
    long rId1 = c1.insert(r1);
    // make sure data has been saved
    {
        ShortResource res = client.getShortResource(rId1);
        assertEquals("r1", res.getName());
    }
    // proper user loads resource
    {
        ShortResource loaded = c1.getShortResource(rId1);
        assertEquals("r1", loaded.getName());
        assertTrue(loaded.isCanEdit());
        assertTrue(loaded.isCanDelete());
    }
    // other user loads resource
    {
        try {
            ShortResource loaded = c2.getShortResource(rId1);
            assertEquals("r1", loaded.getName());
        } catch (UniformInterfaceException ex) {
            assertEquals(Status.FORBIDDEN, ex.getResponse().getClientResponseStatus());
        }
        // 403
    }
    SecurityRule sr = new SecurityRule();
    sr.setGroup(g1);
    sr.setCanRead(true);
    sr.setCanWrite(false);
    SecurityRuleList srlist = new SecurityRuleList(Collections.singletonList(sr));
    c1.updateSecurityRules(rId1, srlist);
    // other user loads resource
    {
        ShortResource loaded = c2.getShortResource(rId1);
        assertEquals("r1", loaded.getName());
        assertFalse(loaded.isCanEdit());
    }
}