@Test
public void testAddUsertoCertificate() throws Exception {

    String responseJson = "{\"messages\":[\"User is successfully associated \"]}";
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(responseJson);       
    CertificateUser certUser = new CertificateUser("testuser1","read", "certificatename.t-mobile.com", "internal");
    String inputJson =new ObjectMapper().writeValueAsString(certUser);
    when(sslCertificateService.addUserToCertificate(Mockito.any(CertificateUser.class), eq(userDetails), Mockito.anyBoolean())).thenReturn(responseEntityExpected);
    mockMvc.perform(MockMvcRequestBuilders.post("/v2/sslcert/user").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)));
}