@Test
public void test_authenticate_AWS_IAM_successfully() {

    String jsonLoginStr = "{\n" +
            "  \"role\": \"testawsrole\",\n" +
            "  \"pkcs7\": \"MIIBjwYJKoZIhvcNAQcDoIIBgDCCAXwCAQAxggE4MIIBNAIBADCBnDCBlDELMAkGA1UEBhMCWkEx====\"\n" +
            "}";
    String jsonStr = "{\n" +
            "  \"iam_http_request_method\": \"POST\",\n" +
            "  \"iam_request_body\": \"{}\",\n" +
            "  \"iam_request_headers\": \"{\"token\":\"4qJC0tWjMDIKjRDDmtcUAZBt\"}\",\n" +
            "  \"iam_request_url\": \"http://testurl.com\",\n" +
            "  \"role\": \"testawsrole\",\n" +
            "  \"pkcs7\": \"MIIBjwYJKoZIhvcNAQcDoIIBgDCCAXwCAQAxggE4MIIBNAIBADCBnDCBlDELMAkGA1UEBhMCWkEx====\"\n" +
            "}";
    AWSAuthLogin awsAuthLogin = new AWSIAMLogin();
    awsAuthLogin.setIam_http_request_method("POST");
    awsAuthLogin.setIam_request_body("{}");
    awsAuthLogin.setIam_request_headers("{\"token\":\"4qJC0tWjMDIKjRDDmtcUAZBt\"}");
    awsAuthLogin.setIam_request_url("http://testurl.com");
    awsAuthLogin.setRole("testawsrole");
    awsAuthLogin.setPkcs7("MIIBjwYJKoZIhvcNAQcDoIIBgDCCAXwCAQAxggE4MIIBNAIBADCBnDCBlDELMAkGA1UEBhMCWkEx====");
    Response response = getMockResponse(HttpStatus.NO_CONTENT, false, "");
    Response responseOk = getMockResponse(HttpStatus.OK, false, "");
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body("{} \t");
    AWSLogin login = new AWSLogin();
    login.setPkcs7(awsAuthLogin.getPkcs7());
    login.setRole(awsAuthLogin.getRole());
    when(JSONUtil.getJSON(Mockito.any())).thenReturn(jsonStr);
    when(reqProcessor.process("/auth/aws/iam/login",jsonStr,"")).thenReturn(responseOk);
    when(ControllerUtil.areAwsLoginInputsValid(AWSAuthType.IAM, awsAuthLogin)).thenReturn(true);
    //when(reqProcessor.process(Mockito.any(),Mockito.any(),Mockito.any())).thenReturn(response);
    ResponseEntity<String> responseEntity = awsAuthService.authenticate(AWSAuthType.IAM, awsAuthLogin);
    assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
    assertEquals(responseEntityExpected, responseEntity);
}