ruanwenjun commented on code in PR #16799:
URL: 
https://github.com/apache/dolphinscheduler/pull/16799#discussion_r1843098805


##########
dolphinscheduler-storage-plugin/dolphinscheduler-storage-hdfs/src/test/java/org/apache/dolphinscheduler/plugin/storage/hdfs/LocalStorageOperatorTest.java:
##########
@@ -296,14 +297,20 @@ public void testListStorageEntityRecursively_directory() {
         String resourceFileAbsolutePath = "file:" + baseDir;
         List<StorageEntity> storageEntities =
                 
storageOperator.listFileStorageEntityRecursively(resourceFileAbsolutePath);
-        assertThat(storageEntities.size()).isEqualTo(1);
-
-        StorageEntity storageEntity2 = storageEntities.get(0);
-        assertThat(storageEntity2.getFullName()).isEqualTo("file:" + 
Paths.get(baseDir, "sqlDirectory", "demo.sql"));
-        assertThat(storageEntity2.getFileName()).isEqualTo("demo.sql");
-        assertThat(storageEntity2.getPfullName()).isEqualTo("file:" + 
Paths.get(baseDir, "sqlDirectory"));
-        assertThat(storageEntity2.isDirectory()).isFalse();
-        assertThat(storageEntity2.getType()).isEqualTo(ResourceType.FILE);
+        assertThat(storageEntities.size()).isEqualTo(3);
+
+        AtomicReference<StorageEntity> storageEntity2 = new 
AtomicReference<>();
+
+        storageEntities.stream()
+                .filter(storageEntity -> 
storageEntity.getFileName().equals("demo.sql"))
+                .findFirst()

Review Comment:
   ```suggestion
           StorageEntity storageEntity2 = storageEntities.stream()
                   .filter(storageEntity -> 
storageEntity.getFileName().equals("demo.sql"))
                   .findFirst()
                   .get();
   ```



-- 
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]

Reply via email to