@SneakyThrows
@Test
void readFromInboxTest() {

    when(dataSafeService.inboxService().read(any())).thenReturn(new ByteArrayInputStream("hello".getBytes()));
    RestDocumentationResultHandler document = document("inbox-read-success",
            pathParameters(
                    parameterWithName("path").description("path to the file")
            ),
            requestHeaders(
                    headerWithName("token").description(TOKEN_DESCRIPTION),
                    headerWithName("user").description(USER_DESCRIPTION),
                    headerWithName("password").description(PASSWORD_DESCRIPTION)
            )
    );
    when(dataSafeService.inboxService().read(any())).thenReturn(new ByteArrayInputStream("hello".getBytes()));
    mvc.perform(get("/inbox/document/{path}", TEST_PATH)
            .header("user", TEST_USER)
            .header("password", TEST_PASS)
            .header("token", token)
            .accept(MediaType.APPLICATION_OCTET_STREAM_VALUE))
            .andExpect(status().isOk())
            .andExpect(header().string(CONTENT_TYPE, APPLICATION_OCTET_STREAM_VALUE))
            .andDo(document);
    verify(inboxService).read(any());
}