From e81adba3ec916a946828f12c24049174e7e458ad Mon Sep 17 00:00:00 2001 From: Quentin Ligier Date: Thu, 26 Sep 2024 20:57:56 +0200 Subject: [PATCH] Gazelle reports: add a success info if there are no messages Fixes #274 --- .../ahdis/matchbox/gazelle/GazelleValidationWs.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/matchbox-server/src/main/java/ch/ahdis/matchbox/gazelle/GazelleValidationWs.java b/matchbox-server/src/main/java/ch/ahdis/matchbox/gazelle/GazelleValidationWs.java index 7abc46f17b..b1523abbfc 100644 --- a/matchbox-server/src/main/java/ch/ahdis/matchbox/gazelle/GazelleValidationWs.java +++ b/matchbox-server/src/main/java/ch/ahdis/matchbox/gazelle/GazelleValidationWs.java @@ -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); @@ -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; }