@SneakyThrows
@Test
void listInboxTest() {

    Uri location = new Uri("s3://bucket/user/inbox/path/to/file.txt");
    PrivateResource privateResource = new BasePrivateResource(location).resolve(new Uri("/path/to/file.txt"), new Uri("/path/to/file.txt"));
    AbsoluteLocation<ResolvedResource> resolvedPrivate = new AbsoluteLocation<>(new BaseResolvedResource(privateResource, Instant.now()));
    when(inboxService.list(any())).thenReturn(Stream.of(resolvedPrivate));
    RestDocumentationResultHandler document = document("inbox-list-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)
            )
    );
    mvc.perform(get("/inbox/documents/{path}", TEST_PATH)
            .header("user", TEST_USER)
            .header("password", TEST_PASS)
            .header("token", token)
            .accept(APPLICATION_JSON_VALUE))
            .andExpect(status().isOk())
            .andDo(document);
    verify(inboxService).list(any());
}