Skip to content

Commit

Permalink
Gazelle reports: add a success info if there are no messages
Browse files Browse the repository at this point in the history
Fixes #274
  • Loading branch information
qligier committed Sep 26, 2024
1 parent 15a8595 commit e81adba
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ MatchboxEngine getEngine(final String canonicalWithVersion,
* Performs the validation of the given item with the given engine.
*/
ValidationSubReport validateItem(final MatchboxEngine engine,
final ValidationItem item,
final ValidationItem item,
final String profile) {
final String content = new String(item.getContent(), StandardCharsets.UTF_8);
final var encoding = EncodingEnum.detectEncoding(content);
Expand All @@ -264,6 +264,17 @@ ValidationSubReport validateItem(final MatchboxEngine engine,
subReport.addUnexpectedError(new UnexpectedError().setMessage("Error during validation: %s".formatted(e.getMessage())));
}

// The EVSClient expects at lest one assertion report, otherwise it will show it as DONE_UNDEFINED (#274)
if (subReport.getAssertionReports().isEmpty()) {
subReport.addAssertionReport(
new AssertionReport()
.setResult(ValidationTestResult.PASSED)
.setSeverity(SeverityLevel.INFO)
.setPriority(RequirementPriority.MANDATORY)
.setDescription("No fatal or error issues detected, the validation has passed")
);
}

return subReport;
}

Expand Down

0 comments on commit e81adba

Please sign in to comment.