77import org .junit .jupiter .api .extension .ExtendWith ;
88import org .mockito .Mock ;
99import org .mockito .junit .jupiter .MockitoExtension ;
10- import org .mockito .junit .jupiter .MockitoSettings ;
11- import org .mockito .quality .Strictness ;
1210import com .fasterxml .jackson .databind .ObjectMapper ;
1311import uk .nhs .adaptors .gp2gp .common .service .FhirParseService ;
1412import uk .nhs .adaptors .gp2gp .common .service .RandomIdGeneratorService ;
2321import static org .mockito .Mockito .when ;
2422
2523@ ExtendWith (MockitoExtension .class )
26- @ MockitoSettings (strictness = Strictness .LENIENT )
2724public class DocumentToMHSTranslatorTest {
2825 private static final String TEST_FILE_DIRECTORY = "/ehr/request/fhir/" ;
2926 private static final String INPUT_DIRECTORY = "input/" ;
@@ -69,8 +66,8 @@ public static void initialize() {
6966
7067 @ BeforeEach
7168 public void setUp () {
72- when (timestampService .now ()).thenReturn (Instant .parse (TEST_DATE_TIME ));
73- when (randomIdGeneratorService .createNewId ()).thenReturn (TEST_ID );
69+ // when(timestampService.now()).thenReturn(Instant.parse(TEST_DATE_TIME));
70+ // when(randomIdGeneratorService.createNewId()).thenReturn(TEST_ID);
7471
7572 documentToMHSTranslator = new DocumentToMHSTranslator (
7673 new ObjectMapper (),
@@ -79,6 +76,9 @@ public void setUp() {
7976
8077 @ Test
8178 void When_TranslatingDocumentData_Expect_ProperMhsOutboundRequestPayload () {
79+ when (timestampService .now ()).thenReturn (Instant .parse (TEST_DATE_TIME ));
80+ when (randomIdGeneratorService .createNewId ()).thenReturn (TEST_ID );
81+
8282 GetGpcDocumentTaskDefinition taskDefinition = GetGpcDocumentTaskDefinition .builder ()
8383 .messageId (MESSAGE_ID )
8484 .documentId (TEST_DOCUMENT_ID )
@@ -92,6 +92,9 @@ void When_TranslatingDocumentData_Expect_ProperMhsOutboundRequestPayload() {
9292
9393 @ Test
9494 void When_TranslatingFileContentData_Expect_ProperMhsOutboundRequestPayload () {
95+ when (timestampService .now ()).thenReturn (Instant .parse (TEST_DATE_TIME ));
96+ when (randomIdGeneratorService .createNewId ()).thenReturn (TEST_ID );
97+
9598 final GetAbsentAttachmentTaskDefinition taskDefinition = GetAbsentAttachmentTaskDefinition .builder ()
9699 .title (TEST_TITLE )
97100 .messageId (MESSAGE_ID )
0 commit comments