Skip to content

Commit

Permalink
update: BaseUserOperationsTestWithDefaultDatasafeTest with root bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
AssahBismarkabah committed Aug 9, 2024
1 parent 0f5a4f4 commit 092025e
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void shareWithJane() {
}
// END_SNIPPET

assertThat(defaultDatasafeServices.inboxService().read(ReadRequest.forDefaultPrivate(jane, "hello.txt")))
assertThat(defaultDatasafeServices.inboxService().read(ReadRequest.forDefaultPrivate(jane, "datasafe-root/hello.txt")))
.hasContent("Hello Jane");
}

Expand All @@ -162,9 +162,9 @@ void shareWithJaneAndJamie() {
}
// END_SNIPPET

assertThat(defaultDatasafeServices.inboxService().read(ReadRequest.forDefaultPrivate(jane, "hello.txt")))
assertThat(defaultDatasafeServices.inboxService().read(ReadRequest.forDefaultPrivate(jane, "datasafe-root/hello.txt")))
.hasContent("Hello Jane and Jamie");
assertThat(defaultDatasafeServices.inboxService().read(ReadRequest.forDefaultPrivate(jamie, "hello.txt")))
assertThat(defaultDatasafeServices.inboxService().read(ReadRequest.forDefaultPrivate(jamie, "datasafe-root/hello.txt")))
.hasContent("Hello Jane and Jamie");
}

Expand Down Expand Up @@ -230,18 +230,18 @@ void listInbox() {
assertThat(johnsInboxFilesInRoot)
.extracting(it -> it.getResource().asPrivate().decryptedPath().toASCIIString())
.containsExactlyInAnyOrder(
"home/my/secret.txt",
"home/watch/films.txt"
"datasafe-root/home/my/secret.txt",
"datasafe-root/home/watch/films.txt"
);

// Now let's list John's home/watch:
List<AbsoluteLocation<ResolvedResource>> johnsInboxFilesInWatch = defaultDatasafeServices.inboxService()
.list(ListRequest.forDefaultPrivate(user, "home/watch")).collect(Collectors.toList());
.list(ListRequest.forDefaultPrivate(user, "datasafe-root/home/watch")).collect(Collectors.toList());
// same files we created
assertThat(johnsInboxFilesInWatch)
.extracting(it -> it.getResource().asPrivate().decryptedPath().toASCIIString())
.containsExactly(
"home/watch/films.txt"
"datasafe-root/home/watch/films.txt"
);
// END_SNIPPET
}
Expand Down

0 comments on commit 092025e

Please sign in to comment.