Skip to content

Commit 8bc6720

Browse files
wqeRAST
1 parent 4b3c2e1 commit 8bc6720

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ void When_MappingAllergyIntoleranceJson_Expect_AllergyStructureXmlOutput(String
160160

161161
@ParameterizedTest
162162
@MethodSource("resourceFileParamsWithEnvironmentCategoryAndConditionRelatedData")
163-
void When_MappingAllergyIntoleranceJson_Expect_AllergyStructureXmlOutputWithEnvironmentCategoryAndConditionRelatedData
164-
(String inputJson, String outputXml) {
163+
void When_MappingAllergyIntoleranceJson_Expect_AllergyStructureXmlOutputWithEnvironmentAndData(String inputJson, String outputXml) {
165164
final var expectedMessage = ResourceTestFileUtils.getFileContent(TEST_FILE_DIRECTORY + outputXml);
166165
final var allergyIntolerance = parseAllergyIntoleranceFromJsonFile(TEST_FILE_DIRECTORY + inputJson);
167166

@@ -185,11 +184,11 @@ void When_MappingInvalidAllergyIntoleranceJson_Expect_Exception(String inputJson
185184
@Test
186185
void When_ConfidentialityServiceReturnsConfidentialityCode_Expect_MessageContainsConfidentialityCode() {
187186
final var allergyIntolerance = parseAllergyIntoleranceFromJsonFile(INPUT_JSON_WITH_OPTIONAL_TEXT_FIELDS);
188-
when(confidentialityService.generateConfidentialityCode(allergyIntolerance))
189-
.thenReturn(Optional.of(CONFIDENTIALITY_CODE));
190-
191187
final var message = allergyStructureMapper.mapAllergyIntoleranceToAllergyStructure(allergyIntolerance);
192188

189+
when(confidentialityService.generateConfidentialityCode(allergyIntolerance))
190+
.thenReturn(Optional.of(CONFIDENTIALITY_CODE));
191+
193192
assertThat(message).contains(CONFIDENTIALITY_CODE);
194193
assertThat(StringUtils.countOccurrencesOf(message, CONFIDENTIALITY_CODE))
195194
.withFailMessage("<confidentialityCode /> should appear within both the CompoundStatement and ObservationStatement")

0 commit comments

Comments
 (0)