GeoStoreClient { public ShortResource getShortResource(long id) { WebResource wr = getBaseWebResource("extjs", "resource", id); return wr.get(ShortResource.class); } GeoStoreClient(); @Deprecated ShortResourceList searchResources(SearchFilter searchFilter); ResourceList searchResources(SearchFilter searchFilter,
            Integer page, Integer entries,
            Boolean includeAttributes, Boolean includeData); Long insert(RESTResource resource); Resource getResource(Long id, boolean full); Resource getResource(Long id); void deleteResource(Long id); void updateResource(Long id, RESTResource resource); ShortResourceList getAllShortResource(Integer page, Integer entries); SecurityRuleList getSecurityRules(Long resourceId); void updateSecurityRules(Long resourceId, SecurityRuleList rules); String getData(Long id); String getData(Long id, MediaType acceptMediaType); byte[] getRawData(Long id, RawFormat decodeFrom); T getRawData(Class<T> clazz, Long id, RawFormat decodeFrom); void setData(Long id, String data); void updateData(Long id, String data); Long insert(RESTCategory category); Category getCategory(Long id); Long getCategoryCount(String nameLike); CategoryList getCategories(Integer page, Integer entries); CategoryList getCategories(); void deleteCategory(Long id); ExtGroupList searchUserGroup(Integer start,Integer limit, String nameLike, boolean all); ExtGroupList searchUserGroup(Integer start,Integer limit, String nameLike); ShortResource getShortResource(long id); String getPassword(); void setPassword(String password); String getUsername(); void setUsername(String username); String getGeostoreRestUrl(); void setGeostoreRestUrl(String geostoreRestUrl);  }
@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); { ShortResource res = client.getShortResource(rId1); assertEquals("r1", res.getName()); } { ShortResource loaded = c1.getShortResource(rId1); assertEquals("r1", loaded.getName()); assertTrue(loaded.isCanEdit()); assertTrue(loaded.isCanDelete()); } { try { ShortResource loaded = c2.getShortResource(rId1); assertEquals("r1", loaded.getName()); } catch (UniformInterfaceException ex) { assertEquals(Status.FORBIDDEN, ex.getResponse().getClientResponseStatus()); } } SecurityRule sr = new SecurityRule(); sr.setGroup(g1); sr.setCanRead(true); sr.setCanWrite(false); SecurityRuleList srlist = new SecurityRuleList(Collections.singletonList(sr)); c1.updateSecurityRules(rId1, srlist); { ShortResource loaded = c2.getShortResource(rId1); assertEquals("r1", loaded.getName()); assertFalse(loaded.isCanEdit()); } }