@SneakyThrows
@Test
void writeToInboxTest() {

    when(dataSafeService.inboxService().write(any())).thenReturn(new ByteArrayOutputStream());
    RestDocumentationResultHandler document = document("inbox-write-success",
            pathParameters(
                    parameterWithName("path").description("path to the file")
            ),
            requestHeaders(
                    headerWithName("token").description(TOKEN_DESCRIPTION),
                    headerWithName("users").description("recipients array")
            )
    );
    mvc.perform(putFileBuilder("/inbox/document/{path}", TEST_PATH)
            .contentType(MediaType.MULTIPART_FORM_DATA_VALUE)
            .header("users", TEST_USER)
            .header("token", token)
    )
            .andExpect(status().isOk())
            .andDo(document);
    verify(inboxService).write(any());
}