@Test
public void testAssociateApproletoCertificate() throws Exception {

	CertificateApprole certificateApprole = new CertificateApprole("certificatename.t-mobile.com", "role1", "read", "internal");
    String inputJson =new ObjectMapper().writeValueAsString(certificateApprole);
    String responseJson = "{\"messages\":[\"Approle successfully associated with Certificate\"]}";
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(responseJson);
    when(sslCertificateService.associateApproletoCertificate(Mockito.any(CertificateApprole.class), eq(userDetails))).thenReturn(responseEntityExpected);
    mockMvc.perform(MockMvcRequestBuilders.post("/v2/sslcert/approle").requestAttr("UserDetails", userDetails)
            .header("vault-token", "5PDrOhsy4ig8L3EpsJZSLAMg")
            .header("Content-Type", "application/json;charset=UTF-8")
            .content(inputJson))
            .andExpect(status().isOk())
            .andExpect(content().string(containsString(responseJson)));
}