diff --git a/src/integrationTest/java/uk/gov/hmcts/darts/event/controller/DarNotifyControllerTest.java b/src/integrationTest/java/uk/gov/hmcts/darts/event/controller/DarNotifyControllerTest.java index 11fd9ea4..bf47dd3b 100644 --- a/src/integrationTest/java/uk/gov/hmcts/darts/event/controller/DarNotifyControllerTest.java +++ b/src/integrationTest/java/uk/gov/hmcts/darts/event/controller/DarNotifyControllerTest.java @@ -94,9 +94,9 @@ void shouldSendDarNotifyEventSoapActionDarPcDateOutSideDriftLimitsRangeBehind(Ca darPcStub.verifyNotificationReceivedWithBody(EXPECTED_DAR_PC_NOTIFICATION); assertThat(capturedOutput) - .containsPattern("Response time from DAR PC is outside max drift limits of 1 minute 30 seconds. DAR PC Response time: " - + responseDateTime.format(DateTimeFormatter.ISO_DATE_TIME) - + ", Current time: [0-9\\-.T:]+Z for courthouse: York in courtroom: 1"); + .containsPattern("Response time from DAR PC is outside max drift limits of 1 minute 30 seconds. DAR PC Response time: '" + + responseDateTime.format(DateTimeFormatter.RFC_1123_DATE_TIME) + + "', Current time: '[A-Za-z]{3}, \\d{1,2} [A-Za-z]{3} \\d{4} \\d{2}:\\d{2}:\\d{2} [A-Z]{3}' for courthouse: York in courtroom: 1"); } @Test @@ -112,9 +112,9 @@ void shouldSendDarNotifyEventSoapActionDarPcDateOutSideDriftLimitsRangeAhead(Cap darPcStub.verifyNotificationReceivedWithBody(EXPECTED_DAR_PC_NOTIFICATION); assertThat(capturedOutput) - .containsPattern("Response time from DAR PC is outside max drift limits of 1 minute 30 seconds. DAR PC Response time: " - + responseDateTime.format(DateTimeFormatter.ISO_DATE_TIME) - + ", Current time: [0-9\\-.T:]+Z for courthouse: York in courtroom: 1"); + .containsPattern("Response time from DAR PC is outside max drift limits of 1 minute 30 seconds. DAR PC Response time: '" + + responseDateTime.format(DateTimeFormatter.RFC_1123_DATE_TIME) + + "', Current time: '[A-Za-z]{3}, \\d{1,2} [A-Za-z]{3} \\d{4} \\d{2}:\\d{2}:\\d{2} [A-Z]{3}' for courthouse: York in courtroom: 1"); } @Test diff --git a/src/main/java/uk/gov/hmcts/darts/event/client/DarNotifyEventClient.java b/src/main/java/uk/gov/hmcts/darts/event/client/DarNotifyEventClient.java index e9d3eaa0..2540e4ae 100644 --- a/src/main/java/uk/gov/hmcts/darts/event/client/DarNotifyEventClient.java +++ b/src/main/java/uk/gov/hmcts/darts/event/client/DarNotifyEventClient.java @@ -162,10 +162,10 @@ public void afterCompletion(MessageContext messageContext, Exception ex) { Event event = XmlParser.unmarshal(darNotifyEvent.getXMLEventDocument(), Event.class); log.warn("Response time from DAR PC is outside max drift limits of {}. " + - "DAR PC Response time: {}, Current time: {} for courthouse: {} in courtroom: {}", + "DAR PC Response time: '{}', Current time: '{}' for courthouse: {} in courtroom: {}", DurationFormatUtils.formatDurationWords(maxTimeDrift.toMillis(), true, true), - responseDateTime.format(DateTimeFormatter.ISO_DATE_TIME), - currentTime.format(DateTimeFormatter.ISO_DATE_TIME), + dateHeader.getValue(), + currentTime.format(DateTimeFormatter.RFC_1123_DATE_TIME), event.getCourthouse(), event.getCourtroom()); }