@Test
public void test_updateAccessPolicy_failure_400() {

    String responseBody = "{\"errors\":[\"Requried Parameter Missing : accessid\"]}";
    Response response =getMockResponse(HttpStatus.BAD_REQUEST, true, responseBody);
    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();
    accessPolicy.setAccess(access);
    String jsonStr = "{\"access\": {\"users/*\": \"read\", \"apps/*\": \"read\",\"shared/*\": \"read\"}\"}";
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.BAD_REQUEST).body(responseBody);
    when(reqProcessor.process("/access/update",jsonStr,token)).thenReturn(response);
    when(JSONUtil.getJSON(accessPolicy)).thenReturn(jsonStr);
    ResponseEntity<String> responseEntity = accessService.updatePolicy(token, accessPolicy);
    assertEquals(HttpStatus.BAD_REQUEST, responseEntity.getStatusCode());
    assertEquals(responseEntityExpected, responseEntity);
}