Skip to content

Commit 3251689

Browse files
Trying to add assertion to fix pitest
1 parent 82ac348 commit 3251689

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ public void validateXmlAgainstSchema(String xml) {
7272
String interactionId = redactionsContext.ehrExtractInteractionId();
7373
boolean isRedactionInteraction = RedactionsContext.REDACTION_INTERACTION_ID.equals(interactionId);
7474

75-
String schemaPath = isRedactionInteraction
76-
? RCMR_IN030000UK07_SCHEMA_PATH
77-
: RCMR_IN030000UK06_SCHEMA_PATH;
75+
String schemaPath = isRedactionInteraction ? RCMR_IN030000UK07_SCHEMA_PATH : RCMR_IN030000UK06_SCHEMA_PATH;
7876
try {
7977
SchemaFactory factory = SchemaFactory.newDefaultInstance();
8078
Schema schema = factory.newSchema(new File(schemaPath));

service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/EhrExtractMapperTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package uk.nhs.adaptors.gp2gp.ehr.mapper;
22

33
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
4+
import static org.junit.Assert.assertTrue;
45
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
56
import static org.mockito.ArgumentMatchers.any;
67
import static org.mockito.ArgumentMatchers.eq;
@@ -17,6 +18,7 @@
1718
import java.util.Collections;
1819

1920
import org.hl7.fhir.dstu3.model.Bundle;
21+
import org.junit.jupiter.api.Assertions;
2022
import org.junit.jupiter.api.Test;
2123
import org.junit.jupiter.api.extension.ExtendWith;
2224
import org.mockito.InjectMocks;
@@ -187,10 +189,9 @@ void When_ValidateXmlAgainstSchemaWithValidXmlAndAnyId_Expect_NoExceptionIsThrow
187189

188190
when(redactionsContext.ehrExtractInteractionId())
189191
.thenReturn(RedactionsContext.REDACTION_INTERACTION_ID);
192+
Assertions.assertTrue(validXml.contains("RCMR_IN030000UK07"));
190193

191194
assertDoesNotThrow(() -> ehrExtractMapper.validateXmlAgainstSchema(validXml));
192195
}
193196

194-
195-
196197
}

0 commit comments

Comments
 (0)