Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void init() {
provider = new S3FileSystemProvider();
lenient().when(mockClient.headObject(any(Consumer.class))).thenReturn(
CompletableFuture.supplyAsync(() -> HeadObjectResponse.builder().contentLength(100L).build()));
fs = provider.newFileSystem(URI.create(pathUri));
fs = provider.getFileSystem(URI.create(pathUri), true);
fs.clientProvider(new FixedS3ClientProvider(mockClient));
}

Expand Down
8 changes: 7 additions & 1 deletion src/test/java/software/amazon/nio/spi/s3/S3PathTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,13 @@ public void testEquals() {
// the working directory, which is always "/" for a bucket.
assertEquals(S3Path.getPath(fileSystem, "dir1/"), S3Path.getPath(fileSystem, "/dir1/"));

assertNotEquals(S3Path.getPath(fileSystem, "dir1/"), S3Path.getPath(provider.newFileSystem(URI.create("s3://foo")), "/dir1/"));
S3FileSystem fooFS = null;
try{
fooFS = provider.newFileSystem(URI.create("s3://foo"));;
assertNotEquals(S3Path.getPath(fileSystem, "dir1/"), S3Path.getPath(fooFS, "/dir1/"));
} finally {
if ( fooFS != null ) provider.closeFileSystem(fooFS);
}

// not equal because in s3 dir1 cannot be implied to be a directory unless it ends with "/"
assertNotEquals(S3Path.getPath(fileSystem, "dir1/"), S3Path.getPath(fileSystem, "dir1"));
Expand Down