4040import static org .assertj .core .api .Assertions .assertThatExceptionOfType ;
4141import static org .junit .jupiter .api .Assertions .assertAll ;
4242import static org .mockito .ArgumentMatchers .any ;
43- import static org .mockito .Mockito .lenient ;
4443import static org .mockito .Mockito .when ;
4544import static uk .nhs .adaptors .gp2gp .utils .ConfidentialityCodeUtility .NOPAT_HL7_CONFIDENTIALITY_CODE ;
4645import static uk .nhs .adaptors .gp2gp .utils .XmlAssertion .assertThatXml ;
@@ -158,11 +157,7 @@ void setUp() {
158157 ));
159158
160159 InputBundle inputBundle = new InputBundle (bundle );
161- lenient ().when (messageContext .getInputBundleHolder ()).thenReturn (inputBundle );
162- lenient ().when (messageContext .getAgentDirectory ()).thenReturn (agentDirectory );
163- lenient ().when (agentDirectory .getAgentId (any (Reference .class ))).thenAnswer (mockReference ());
164- lenient ().when (agentDirectory .getAgentRef (any (Reference .class ), any (Reference .class ))).thenAnswer (mockReferences ());
165-
160+ when (messageContext .getInputBundleHolder ()).thenReturn (inputBundle );
166161 when (messageContext .getIdMapper ()).thenReturn (idMapper );
167162 when (idMapper .getOrNew (any (ResourceType .class ), any (IdType .class )))
168163 .thenAnswer (params -> "Mapped-From-" + ((IdType ) params .getArgument (1 )).getValue ());
@@ -188,7 +183,7 @@ void When_MappingObservationJson_Expect_CompoundStatementXmlOutput(String inputJ
188183 final Observation observationAssociatedWithSpecimen = getObservationResourceFromJson (inputJson );
189184 final String expectedXml = getXmlStringFromFile (outputXml );
190185
191- lenient (). when (randomIdGeneratorService .createNewId ())
186+ when (randomIdGeneratorService .createNewId ())
192187 .thenReturn ("random-unmapped-id" );
193188
194189 final String actualXml = observationMapper .mapObservationToCompoundStatement (
0 commit comments