@Test
public void test_authenticate_AWS_EC2_successfully() {

    String jsonLoginStr = "{\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, "");
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.NO_CONTENT).body("{} \t");
    AWSLogin login = new AWSLogin();
    login.setPkcs7(awsAuthLogin.getPkcs7());
    login.setRole(awsAuthLogin.getRole());
    when(JSONUtil.getJSON(Mockito.any())).thenReturn(jsonLoginStr);
    when(ControllerUtil.areAwsLoginInputsValid(AWSAuthType.EC2, awsAuthLogin)).thenReturn(true);
    when(reqProcessor.process(Mockito.any(),Mockito.any(),Mockito.any())).thenReturn(response);
    ResponseEntity<String> responseEntity = awsAuthService.authenticate(AWSAuthType.EC2, awsAuthLogin);
    assertEquals(HttpStatus.NO_CONTENT, responseEntity.getStatusCode());
    assertEquals(responseEntityExpected, responseEntity);
}