@Test
public void test_createIAMRole_successfully() {

    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\": \"string\"}";
    Response response = getMockResponse(HttpStatus.NO_CONTENT, true, "");
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body("{\"messages\":[\"AWS IAM Role created successfully \"]}");
    when(reqProcessor.process("/auth/aws/iam/role/create",jsonStr, token)).thenReturn(response);
    when(JSONUtil.getJSON(awsiamRole)).thenReturn(jsonStr);
    UserDetails userDetails = getMockUser(true);
    when(ControllerUtil.createMetadata(Mockito.any(), eq(token))).thenReturn(true);
    try {
        when(ControllerUtil.areAWSIAMRoleInputsValid(awsiamRole)).thenReturn(true);
        ResponseEntity<String> responseEntity = awsIamAuthService.createIAMRole(awsiamRole, token, userDetails);
        assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
        assertEquals(responseEntityExpected, responseEntity);
    } catch (TVaultValidationException e) {
        e.printStackTrace();
    }
}