Skip to content

Commit

Permalink
fixed empty filter situation (via #16)
Browse files Browse the repository at this point in the history
  • Loading branch information
danilishe authored Dec 10, 2020
1 parent d0f44c4 commit 2a5f792
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public AllurePDFGenerator(final String reportName, final Path reportPath) {
}

public void filter(final Map<String, String> tags) {
this.filter.putAll(tags);
if (tags != null) {
this.filter.putAll(tags);
}
}

public void generate(final Path outputPath) throws IOException {
Expand Down Expand Up @@ -98,9 +100,8 @@ public void generate(final Path outputPath) throws IOException {
boolean shouldSkip = Objects.nonNull(filter)
&& !filter.isEmpty()
&& !filter.entrySet().stream().allMatch(e -> labels.getOrDefault(e.getKey(), new ArrayList<>()).contains(e.getValue()));
if (!shouldSkip) {
printTestResultDetails(document, result, fontHolder);
}
if (shouldSkip) continue;
printTestResultDetails(document, result, fontHolder);
}
}
}
Expand Down

0 comments on commit 2a5f792

Please sign in to comment.