@Test
public void test_deleteRole_successfully() {

    Response response = getMockResponse(HttpStatus.NO_CONTENT, true, "");
    String token = "5PDrOhsy4ig8L3EpsJZSLAMg";
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body("{\"messages\":[\"Role deleted \"]}");
    when(reqProcessor.process("/auth/aws/roles/delete", "{\"role\":\"mytestawsrole\"}", token)).thenReturn(response);
    UserDetails userDetails = getMockUser(false);
    String metadatajson = "{ \"path\": \"metadata/awsrole/mytestawsrole\", \"data\": {\"createdBy\":\"normaluser\"}}";
    when(ControllerUtil.populateAWSMetaJson("mytestawsrole", userDetails.getUsername())).thenReturn(metadatajson);
    when(reqProcessor.process("/delete",metadatajson,token)).thenReturn(response);
    Response permissonResponse = getMockResponse(HttpStatus.OK, true, "");
    when(ControllerUtil.canDeleteRole("mytestawsrole", token, userDetails, TVaultConstants.AWSROLE_METADATA_MOUNT_PATH)).thenReturn(permissonResponse);
    ResponseEntity<String> responseEntity = awsAuthService.deleteRole(token, "mytestawsrole", userDetails);
    assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
    assertEquals(responseEntityExpected, responseEntity);
}