@Test
public void test_updateIAMRole_failure_400() {

    String token = "5PDrOhsy4ig8L3EpsJZSLAMg";
    AWSIAMRole awsiamRole = new AWSIAMRole();
    awsiamRole.setAuth_type("iam");
    String[] arns = {"arn:aws:iam::123456789012:user/tst"};
    awsiamRole.setBound_iam_principal_arn(arns);
    String[] policies = {"default"};
    awsiamRole.setPolicies(policies);
    awsiamRole.setResolve_aws_unique_ids(true);
    awsiamRole.setRole("string");
    String jsonStr = "{\"auth_type\": \"iam\",\"bound_iam_principal_arn\":" +
            " [\"arn:aws:iam::123456789012:user/tst\"],\"policies\": " +
            "[\"string\"],\"resolve_aws_unique_ids\": true,\"role\": \"mytestawsrole\"}";
    Response getResponse = getMockResponse(HttpStatus.NOT_FOUND, false, "");
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.BAD_REQUEST).body("{\"messages\":[\"Update failed . AWS Role does not exist \"]}");
    when(JSONUtil.getJSON(awsiamRole)).thenReturn(jsonStr);
    when(reqProcessor.process("/auth/aws/iam/roles","{\"role\":\"mytestawsrole\"}",token)).thenReturn(getResponse);
    try {
        when(ControllerUtil.areAWSIAMRoleInputsValid(awsiamRole)).thenReturn(true);
        ResponseEntity<String> responseEntity = awsIamAuthService.updateIAMRole(token, awsiamRole);
        assertEquals(HttpStatus.BAD_REQUEST, responseEntity.getStatusCode());
        assertEquals(responseEntityExpected, responseEntity);
    } catch (TVaultValidationException e) {
        e.printStackTrace();
    }
}