Skip to content

Commit

Permalink
checking type of failures
Browse files Browse the repository at this point in the history
  • Loading branch information
AssahBismarkabah committed Oct 6, 2024
1 parent b1d79e0 commit b1069cf
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import de.adorsys.datasafe.types.api.utils.ExecutorServiceUtil;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.assertj.core.api.AbstractStringAssert;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
Expand All @@ -27,6 +28,7 @@
import java.io.OutputStream;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static de.adorsys.datasafe.types.api.shared.DockerUtil.getDockerUri;
import static org.assertj.core.api.Assertions.assertThat;
Expand Down Expand Up @@ -91,10 +93,15 @@ void init() {
void list() {
createFileWithMessage();

assertThat(storageService.list(root))
.hasSize(1)
.extracting(AbsoluteLocation::location)
.asString().contains(FILE);
Stream<AbsoluteLocation<ResolvedResource>> list = storageService.list(root);
AbstractStringAssert<?> stringAssert = assertThat(list)
.hasSize(1).extracting(AbsoluteLocation::location)
.asString();
// Adding this line to check if the List is NotEmpty or NotNull
stringAssert.isNotEmpty();
stringAssert.isNotNull();
stringAssert.doesNotContain("java");
stringAssert.contains(FILE);
}

@Test
Expand Down

0 comments on commit b1069cf

Please sign in to comment.