Skip to content

Commit b2003dc

Browse files
Tried fixing the pitest
1 parent 66f6262 commit b2003dc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/EhrExtractMapper.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ public String mapEhrExtractToXml(EhrExtractTemplateParameters ehrExtractTemplate
6969

7070

7171
public void validateXmlAgainstSchema(String xml) {
72-
String schemaPath = RedactionsContext.REDACTION_INTERACTION_ID.equals(redactionsContext.ehrExtractInteractionId())
72+
String interactionId = redactionsContext.ehrExtractInteractionId();
73+
boolean isRedactionInteraction = RedactionsContext.REDACTION_INTERACTION_ID.equals(interactionId);
74+
75+
String schemaPath = isRedactionInteraction
7376
? RCMR_IN030000UK07_SCHEMA_PATH
7477
: RCMR_IN030000UK06_SCHEMA_PATH;
7578

@@ -82,7 +85,7 @@ public void validateXmlAgainstSchema(String xml) {
8285

8386
LOGGER.info("XML successfully validated against schema: {}", schemaPath);
8487
} catch (SAXException | IOException e) {
85-
LOGGER.error("XML validation failed: {}", e.getMessage(), e);
88+
LOGGER.error("XML validation failed against schema {}: {}", schemaPath, e.getMessage(), e);
8689
throw new XmlSchemaValidationException("XML schema validation failed", e);
8790
}
8891
}

0 commit comments

Comments
 (0)