Skip to content

Commit

Permalink
test: Make test to proof the problem
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsbasjes committed Dec 5, 2022
1 parent 2f13792 commit 9d8fb31
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.SeekableByteChannel;
import java.nio.file.AccessMode;
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.FileSystem;
import java.nio.file.FileVisitResult;
Expand All @@ -63,6 +64,7 @@
import java.nio.file.StandardCopyOption;
import java.nio.file.StandardOpenOption;
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.spi.FileSystemProvider;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -1196,6 +1198,16 @@ public void testCopy_replaceFile_withOption_srcDoesNotExist() throws IOException
}
}

@Test
public void testCheckAccessRoot() throws Exception {
FileSystem fileSystem = getTestBucket();
Path path = fileSystem.getPath("/");
FileSystemProvider provider = fileSystem.provider();

// Against the real cloud storage this used to throw a StorageException.
provider.checkAccess(path, AccessMode.READ, AccessMode.WRITE);
}

private CloudStorageFileSystem getTestBucket() throws IOException {
// in typical usage we use the single-argument version of forBucket
// and rely on the user being logged into their project with the
Expand Down

0 comments on commit 9d8fb31

Please sign in to comment.