AdministrativeNotificationResource implements Listable { @Override public SimpleObject getAll(RequestContext requestContext) throws ResponseException { List<AdministrativeNotification> notifications = Context.getService(AdministrativeNotificationService.class).getAdministrativeNotifications(); return new NeedsPaging<AdministrativeNotification>(notifications, requestContext).toSimpleObject(null); }  @Override SimpleObject getAll(RequestContext requestContext); @Override String getUri(Object o);  }
@Test public void testGetAll() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(RequestMethod.GET.toString(), "/rest/v1/administrativenotification"); request.addHeader("content-type", "application/json"); SimpleObject results = deserialize(handle(request)); assertThat(((List) results.get("results")).size(), is(1)); Map<String, Object> result = (Map<String, Object>) ((List) results.get("results")).get(0); assertThat((String) result.get("id"), is("id")); assertThat((String) result.get("label"), is("label")); assertThat(((Collection) result.get("actions")).size(), is(1)); }