Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Commit 4566cd9

Browse files
committed
fix(test): update NIOTest to ensure LocalStorageHelper is used
When starting a test, there is a `gs://` uri which is referenced before any unit test level configuration of CloudStorageFileSystemProvider. If NIOTest runs as the first test in the JVM, CloudStorageFileSystemProvider will initialize internally using all default options (which are production endpoints). This fix ensures that before the `gs://` uri is resolved in the NIOTests that LocalStorageHelper is configured rather than defaults.
1 parent 849c859 commit 4566cd9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio

google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/NIOTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import static com.google.common.truth.Truth.assertThat;
2020

21+
import com.google.cloud.storage.contrib.nio.testing.LocalStorageHelper;
2122
import com.google.cloud.testing.junit4.MultipleAttemptsRule;
2223
import java.net.URI;
2324
import java.nio.file.Path;
@@ -40,6 +41,7 @@ public class NIOTest {
4041

4142
@Before
4243
public void setUp() {
44+
CloudStorageFileSystemProvider.setStorageOptions(LocalStorageHelper.getOptions());
4345
uriToCloudStorage = URI.create("gs://bucket/file.txt");
4446
}
4547

0 commit comments

Comments
 (0)