@Test
public void test_authenticate() throws Exception {

    AWSAuthLogin awsAuthLogin = new AWSIAMLogin();
    awsAuthLogin.setIam_http_request_method("POST");
    awsAuthLogin.setIam_request_body("{}");
    awsAuthLogin.setIam_request_headers("{\"token\":\"5PDrOhsy4ig8L3EpsJZSLAMg\"}");
    awsAuthLogin.setIam_request_url("http://testurl.com");
    awsAuthLogin.setRole("testawsrole");
    awsAuthLogin.setPkcs7("MIIBjwYJKoZIhvcNAQcDoIIBgDCCAXwCAQAxggE4MIIBNAIBADCBnDCBlDELMAkGA1UEBhMCWkEx====");
    String inputJson =new ObjectMapper().writeValueAsString(awsAuthLogin);
    String responseMessage = "sample response";
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(responseMessage);
    when(awsAuthService.authenticate(Mockito.any(), Mockito.any())).thenReturn(responseEntityExpected);
    mockMvc.perform(MockMvcRequestBuilders.post("/v2/auth/aws/login/EC2")
            .header("vault-token", "5PDrOhsy4ig8L3EpsJZSLAMg")
            .header("Content-Type", "application/json;charset=UTF-8")
            .content(inputJson))
            .andExpect(status().isOk())
            .andExpect(content().string(containsString(responseMessage)));
}