nastra commented on code in PR #8168:
URL: https://github.com/apache/iceberg/pull/8168#discussion_r1284471891
##########
gcp/src/test/java/org/apache/iceberg/gcp/gcs/GCSFileIOTest.java:
##########
@@ -100,6 +121,70 @@ public void testDelete() {
.isZero();
}
+ private String gsUri(String path) {
+ return format("gs://%s/%s", TEST_BUCKET, path);
+ }
+
+ @Test
+ public void testListPrefix() {
+ String prefix = "list/path/";
+ String path1 = prefix + "data1.dat";
+ storage.create(BlobInfo.newBuilder(TEST_BUCKET, path1).build());
+ String path2 = prefix + "data2.dat";
+ storage.create(BlobInfo.newBuilder(TEST_BUCKET, path2).build());
+ String path3 = "list/skip/data3.dat";
+ storage.create(BlobInfo.newBuilder(TEST_BUCKET, path3).build());
+
+
assertThat(StreamSupport.stream(io.listPrefix(gsUri("list/")).spliterator(),
false).count())
Review Comment:
sorry I missed this initially, but there's no need to wrap this in a stream.
This (and other places) can be simplified to
`assertThat(io.listPrefix(gsUri("list/"))).hasSize(3);`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]