importorg.activiti.rest.BaseRestTestCase;importorg.codehaus.jackson.JsonNode;importorg.restlet.representation.Representation;importorg.restlet.resource.ClientResource;publicclassUserSearchResourceTestextendsBaseRestTestCase{publicvoidtestGetAllUsers()throwsException{ClientResourceclient=getAuthenticatedClient("users");try{client.get();fail();}catch(Exceptione){// not allowed, should provide search text}}publicvoidtestGetUsers()throwsException{ClientResourceclient=getAuthenticatedClient("users?searchText=erm");Representationresponse=client.get();JsonNoderesponseNode=objectMapper.readTree(response.getStream());assertNotNull(responseNode);assertEquals(1,responseNode.get("total").asInt());JsonNodeuserNode=responseNode.get("data").get(0);assertEquals("Kermit",userNode.get("firstName").asText());}}