@Test
public void test_addUserToSafe() throws Exception {

    SafeUser safeUser = new SafeUser("users/safe1", "testuser1","write");
    String inputJson =new ObjectMapper().writeValueAsString(safeUser);
    String responseJson = "{\"messages\":[\"User is successfully associated \"]}";
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(responseJson);
    when(safesService.addUserToSafe(eq("5PDrOhsy4ig8L3EpsJZSLAMg"), Mockito.any(), eq(null))).thenReturn(responseEntityExpected);
    mockMvc.perform(MockMvcRequestBuilders.post("/v2/sdb/user")
            .header("vault-token", "5PDrOhsy4ig8L3EpsJZSLAMg")
            .header("Content-Type", "application/json;charset=UTF-8")
            .content(inputJson))
            .andExpect(status().isOk())
            .andExpect(content().string(containsString(responseJson)));
}