Skip to content

Commit 64ca46e

Browse files
Remove unused import, rename variables, move test code around
1 parent 10aa070 commit 64ca46e

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

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

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import static java.nio.charset.StandardCharsets.UTF_8;
2121

2222
import com.google.cloud.storage.StorageOptions;
23-
import com.google.common.collect.ImmutableList;
2423
import com.google.common.testing.EqualsTester;
2524
import com.google.common.testing.NullPointerTester;
2625

@@ -166,18 +165,18 @@ public void testListFiles() throws IOException {
166165
public void testMatcher() throws IOException {
167166
try (FileSystem fs = CloudStorageFileSystem.forBucket("bucket")) {
168167
String pattern1 = "glob:*.java";
169-
PathMatcher matcher1 = fs.getPathMatcher(pattern1);
168+
PathMatcher javaFileMatcher = fs.getPathMatcher(pattern1);
169+
assertMatches(fs, javaFileMatcher, "a.java", true);
170+
assertMatches(fs, javaFileMatcher, "a.text", false);
171+
assertMatches(fs, javaFileMatcher, "folder/c.java", true);
172+
assertMatches(fs, javaFileMatcher, "d", false);
173+
170174
String pattern2 = "glob:*.{java,text}";
171-
PathMatcher matcher2 = fs.getPathMatcher(pattern2);
172-
173-
assertMatches(fs, matcher1, "a.java", true);
174-
assertMatches(fs, matcher1, "a.text", false);
175-
assertMatches(fs, matcher1, "folder/c.java", true);
176-
assertMatches(fs, matcher1, "d", false);
177-
assertMatches(fs, matcher2, "a.java", true);
178-
assertMatches(fs, matcher2, "a.text", true);
179-
assertMatches(fs, matcher2, "folder/c.java", true);
180-
assertMatches(fs, matcher2, "d", false);
175+
PathMatcher javaAndTextFileMatcher = fs.getPathMatcher(pattern2);
176+
assertMatches(fs, javaAndTextFileMatcher, "a.java", true);
177+
assertMatches(fs, javaAndTextFileMatcher, "a.text", true);
178+
assertMatches(fs, javaAndTextFileMatcher, "folder/c.java", true);
179+
assertMatches(fs, javaAndTextFileMatcher, "d", false);
181180
}
182181
}
183182

0 commit comments

Comments
 (0)