Skip to content

Commit 91ea318

Browse files
committed
addressing pitest complains
1 parent f375d55 commit 91ea318

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,21 @@ void When_MappingTestResult_With_NopatMetaSecurity_Expect_ConfidentialityCodeWit
273273
assertThatXml(actualXml).containsXPath(OBSERVATION_STATEMENT_CONFIDENTIALITY_CODE_XPATH);
274274
}
275275

276+
@Test
277+
void When_ObservationDoesNotContainNotPresentElements_Expect_MappedObservetionNotContainAggregateComments() {
278+
final Observation observation = getObservationResourceFromJson(OBSERVATION_TEST_RESULT_JSON);
279+
280+
ConfidentialityCodeUtility.appendNopatSecurityToMetaForResource(observation);
281+
when(confidentialityService.generateConfidentialityCode(observation))
282+
.thenReturn(Optional.of(NOPAT_HL7_CONFIDENTIALITY_CODE));
283+
284+
final String actualXml = observationMapper.mapObservationToCompoundStatement(observation);
285+
286+
String expression = "/component/NarrativeStatement/text[contains(normalize-space(.), 'AGGREGATE COMMENT SET')]";
287+
288+
assertThatXml(actualXml).doesNotContainXPath(expression);
289+
}
290+
276291
@Test
277292
void When_MappingTestResult_With_NoscrubMetaSecurity_Expect_ConfidentialityCodeNotPresent() {
278293
final Observation observation = getObservationResourceFromJson(OBSERVATION_TEST_RESULT_JSON);

0 commit comments

Comments
 (0)