Skip to content

Commit

Permalink
feature 16901
Browse files Browse the repository at this point in the history
  • Loading branch information
SbloodyS committed Nov 15, 2024
1 parent 0b84be7 commit 0d44ef4
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;

import lombok.SneakyThrows;

Expand Down Expand Up @@ -299,18 +298,16 @@ public void testListStorageEntityRecursively_directory() {
storageOperator.listFileStorageEntityRecursively(resourceFileAbsolutePath);
assertThat(storageEntities.size()).isEqualTo(3);

AtomicReference<StorageEntity> storageEntity2 = new AtomicReference<>();

storageEntities.stream()
StorageEntity storageEntity2 = storageEntities.stream()
.filter(storageEntity -> storageEntity.getFileName().equals("demo.sql"))
.findFirst()
.ifPresent(storageEntity2::set);;
assertThat(storageEntity2.get().getFullName())
.get();
assertThat(storageEntity2.getFullName())
.isEqualTo("file:" + Paths.get(baseDir, "sqlDirectory", "demo.sql"));
assertThat(storageEntity2.get().getFileName()).isEqualTo("demo.sql");
assertThat(storageEntity2.get().getPfullName()).isEqualTo("file:" + Paths.get(baseDir, "sqlDirectory"));
assertThat(storageEntity2.get().isDirectory()).isFalse();
assertThat(storageEntity2.get().getType()).isEqualTo(ResourceType.FILE);
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);
}

@SneakyThrows
Expand Down

0 comments on commit 0d44ef4

Please sign in to comment.