diff --git a/validation/citrus-validation-xml/src/main/java/org/citrusframework/validation/xml/DomXmlMessageValidator.java b/validation/citrus-validation-xml/src/main/java/org/citrusframework/validation/xml/DomXmlMessageValidator.java index ef4b93c803..8609a53463 100644 --- a/validation/citrus-validation-xml/src/main/java/org/citrusframework/validation/xml/DomXmlMessageValidator.java +++ b/validation/citrus-validation-xml/src/main/java/org/citrusframework/validation/xml/DomXmlMessageValidator.java @@ -49,6 +49,7 @@ import java.util.Map.Entry; import static org.citrusframework.util.StringUtils.hasText; +import static org.citrusframework.util.XMLUtils.prettyPrint; /** * Default message validator implementation. Working on XML messages @@ -77,8 +78,7 @@ public DomXmlMessageValidator(XmlSchemaValidation schemaValidator) { @Override public void validateMessage(Message receivedMessage, Message controlMessage, TestContext context, XmlMessageValidationContext validationContext) throws ValidationException { - logger.debug("Start XML message validation ..."); - + logger.debug("Start XML message validation: {}", prettyPrint(receivedMessage.getPayload(String.class))); try { if (validationContext.isSchemaValidationEnabled()) { schemaValidator.validate(receivedMessage, context, validationContext); @@ -103,9 +103,6 @@ public void validateMessage(Message receivedMessage, Message controlMessage, logger.debug("XML message validation successful: All values OK"); } catch (ClassCastException | DOMException | LSException e) { throw new CitrusRuntimeException(e); - } catch (ValidationException ex) { - logger.error("Failed to validate:\n{}", XMLUtils.prettyPrint(receivedMessage.getPayload(String.class))); - throw ex; } }