@Test
public void test_createAccessPolicy_successfully() {

    Response response =getMockResponse(HttpStatus.OK, true, "");
    String token = "5PDrOhsy4ig8L3EpsJZSLAMg";
    HashMap<String, String> access = new HashMap<>();
    access.put("users/*", "read");
    access.put("apps/*", "read");
    access.put("shared/*", "read");
    AccessPolicy accessPolicy = new AccessPolicy("my-test-policy", access);
    String jsonStr = "{\"access\": { \"users/*\": \"read\", \"apps/*\": \"read\",\"shared/*\": \"read\" }, \"accessid\": \"my-test-policy\"}";
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body("{\"messages\":[\"Access Policy created \"]}");
    when(reqProcessor.process("/access/create",jsonStr,token)).thenReturn(response);
    when(JSONUtil.getJSON(accessPolicy)).thenReturn(jsonStr);
    ResponseEntity<String> responseEntity = accessService.createPolicy(token, accessPolicy);
    assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
    assertEquals(responseEntityExpected, responseEntity);
}