Skip to content

Commit bb93f5e

Browse files
Removed Lenient from ObservationStatementMapperTest
1 parent c2fdd63 commit bb93f5e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import static org.junit.jupiter.api.Assertions.assertThrows;
66
import static org.mockito.ArgumentMatchers.any;
77
import static org.mockito.ArgumentMatchers.anyString;
8-
import static org.mockito.Mockito.lenient;
98
import static org.mockito.Mockito.when;
109

1110
import static uk.nhs.adaptors.gp2gp.common.configuration.RedactionsContext.REDACTION_INTERACTION_ID;
@@ -209,8 +208,7 @@ class ObservationStatementMapperTest {
209208

210209
@BeforeEach
211210
void setUp() {
212-
lenient().when(randomIdGeneratorService.createNewId()).thenReturn(TEST_ID);
213-
lenient().when(randomIdGeneratorService.createNewOrUseExistingUUID(anyString())).thenReturn(TEST_ID);
211+
when(randomIdGeneratorService.createNewOrUseExistingUUID(anyString())).thenReturn(TEST_ID);
214212

215213
when(codeableConceptCdMapper.mapCodeableConceptToCd(any(CodeableConcept.class)))
216214
.thenReturn(CodeableConceptMapperMockUtil.NULL_FLAVOR_CODE);
@@ -254,6 +252,7 @@ void When_MappingParsedObservationWithNopat_Expect_ObservationStatementWithConfi
254252
@ParameterizedTest
255253
@MethodSource("resourceFileParams")
256254
void When_MappingObservationJson_Expect_ObservationStatementXmlOutput(String inputJson, String outputXml) {
255+
when(randomIdGeneratorService.createNewId()).thenReturn(TEST_ID);
257256
messageContext.getAgentDirectory().getAgentId(buildReference(ResourceType.Practitioner, "something"));
258257

259258
expectedOutputMessage = ResourceTestFileUtils.getFileContent(outputXml);
@@ -267,6 +266,7 @@ void When_MappingObservationJson_Expect_ObservationStatementXmlOutput(String inp
267266
@ParameterizedTest
268267
@MethodSource("resourceFileParamsThrowError")
269268
void When_MappingObservationJson_Expect_ErrorThrown(String inputJson, Class expectedClass) {
269+
when(randomIdGeneratorService.createNewId()).thenReturn(TEST_ID);
270270
messageContext.getAgentDirectory().getAgentId(buildReference(ResourceType.Practitioner, "something"));
271271

272272
var jsonInput = ResourceTestFileUtils.getFileContent(inputJson);

0 commit comments

Comments
 (0)