@Test
public void test_write() throws Exception {

    String inputJson ="{\"path\":\"shared/mysafe01/myfolder\",\"data\":{\"secret1\":\"value1\",\"secret2\":\"value2\"}}";
    String responseMessage = "{\"messages\":[\"Secret saved to vault\"]}";
    ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(responseMessage);
    when(secretService.write(eq("5PDrOhsy4ig8L3EpsJZSLAMg"), Mockito.any(), Mockito.any())).thenReturn(responseEntityExpected);
    mockMvc.perform(MockMvcRequestBuilders.post("/v2/write")
            .header("vault-token", "5PDrOhsy4ig8L3EpsJZSLAMg")
            .header("Content-Type", "application/json;charset=UTF-8")
            .content(inputJson))
            .andExpect(status().isOk())
            .andExpect(content().string(containsString(responseMessage)));
}