From 8a59bb32398e09e1a03afc741df923f20759911b Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Tue, 28 Nov 2023 14:02:34 -0500 Subject: [PATCH 01/11] improvement(TripMonitorNotification): Separate initial notif addon text if no other notifs. --- .../middleware/models/TripMonitorNotification.java | 13 +++++++++++-- .../tripmonitor/jobs/CheckMonitoredTrip.java | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java index 5ea86804e..ee1f622c6 100644 --- a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java +++ b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java @@ -96,11 +96,20 @@ public static TripMonitorNotification createItineraryNotFoundNotification( /** * Creates an initial reminder of the itinerary monitoring. */ - public static TripMonitorNotification createInitialReminderNotification(MonitoredTrip trip) { + public static TripMonitorNotification createInitialReminderNotification( + MonitoredTrip trip, + boolean noOtherNotifications + ) { TripMonitorNotification notification = new TripMonitorNotification(); notification.type = NotificationType.INITIAL_REMINDER; // TODO: i18n and add itinerary details. - notification.body = String.format("Reminder for your upcoming trip at %s. We will let you know if anything changes.", trip.tripTime); + StringBuilder body = new StringBuilder(); + body.append(String.format("Reminder for your upcoming trip at %s.", trip.tripTime)); + if (noOtherNotifications) { + body.append(" "); + body.append("We will let you know if anything changes."); + } + notification.body = body.toString(); return notification; } diff --git a/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java b/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java index 1287be92f..f9a0ec549 100644 --- a/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java +++ b/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java @@ -141,7 +141,7 @@ private void addInitialReminderIfNeeded() { if (!trip.isInactive() && isFirstTimeCheckWithinLeadMonitoringTime && userWantsInitialReminder) { enqueueNotification( - TripMonitorNotification.createInitialReminderNotification(trip) + TripMonitorNotification.createInitialReminderNotification(trip, notifications.isEmpty()) ); } } From bf224d18920a263fe6e1a9567413cc24ad130551 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Tue, 28 Nov 2023 14:54:11 -0500 Subject: [PATCH 02/11] fix(CheckMonitoredTrip): Add initial reminder after other check logic. --- .../middleware/tripmonitor/jobs/CheckMonitoredTrip.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java b/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java index f9a0ec549..1516bb599 100644 --- a/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java +++ b/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java @@ -119,10 +119,10 @@ private void doRun() { return; } - // Initial reminder notification, if needed - addInitialReminderIfNeeded(); // Check monitored trip. runCheckLogic(); + // Initial reminder notification, if needed, with text based on other notifications for this trip. + addInitialReminderIfNeeded(); // Send notifications to user. This should happen before updating the journey state so that we can check the // last notification sent. sendNotifications(); From 2cfff4ac33cb0f95767ec9592568a1612aff1633 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Tue, 28 Nov 2023 14:55:18 -0500 Subject: [PATCH 03/11] refactor(TripMonitorNotification): Add and use ctor when creating notification instances. --- .../models/TripMonitorNotification.java | 67 ++++++++++--------- 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java index ee1f622c6..aa30ab3f6 100644 --- a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java +++ b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java @@ -16,8 +16,13 @@ */ public class TripMonitorNotification extends Model { private static final Logger LOG = LoggerFactory.getLogger(TripMonitorNotification.class); - public NotificationType type; - public String body; + public final NotificationType type; + public final String body; + + public TripMonitorNotification(NotificationType type, String body) { + this.type = type; + this.body = body; + } public static TripMonitorNotification createAlertNotification( Set previousAlerts, @@ -30,15 +35,15 @@ public static TripMonitorNotification createAlertNotification( HashSet resolvedAlerts = new HashSet<>(previousAlerts); resolvedAlerts.removeAll(newAlerts); // If there is no change in alerts from previous check, no notification should be created. - if (unseenAlerts.size() == 0 && resolvedAlerts.size() == 0) { + if (unseenAlerts.isEmpty() && resolvedAlerts.isEmpty()) { return null; } // Otherwise, construct a notification from the alert sets. - TripMonitorNotification notification = new TripMonitorNotification(); - // FIXME: notification type should be determined from alert sets (ALERT_ALL_CLEAR, etc.)? - notification.type = NotificationType.ALERT_FOUND; - notification.body = bodyFromAlerts(previousAlerts, resolvedAlerts, unseenAlerts); - return notification; + return new TripMonitorNotification( + // FIXME: notification type should be determined from alert sets (ALERT_ALL_CLEAR, etc.)? + NotificationType.ALERT_FOUND, + bodyFromAlerts(previousAlerts, resolvedAlerts, unseenAlerts) + ); } /** @@ -53,8 +58,6 @@ public static TripMonitorNotification createDelayNotification( Date targetDatetime, NotificationType delayType ) { - TripMonitorNotification notification = new TripMonitorNotification(); - notification.type = delayType; if (delayType != NotificationType.ARRIVAL_DELAY && delayType != NotificationType.DEPARTURE_DELAY) { LOG.error("Delay notification not permitted for type {}", delayType); return null; @@ -68,15 +71,17 @@ public static TripMonitorNotification createDelayNotification( delayHumanTime = String.format("%d minute%s early", delayInMinutes, delayInMinutes < -1 ? "s" : ""); } - notification.body = String.format( - "Your trip is now predicted to %s %s (at %s).", - delayType == NotificationType.ARRIVAL_DELAY ? "arrive" : "depart", - delayHumanTime, - ZonedDateTime - .ofInstant(targetDatetime.toInstant(), DateTimeUtils.getOtpZoneId()) - .format(DateTimeUtils.NOTIFICATION_TIME_FORMATTER) + return new TripMonitorNotification( + delayType, + String.format( + "Your trip is now predicted to %s %s (at %s).", + delayType == NotificationType.ARRIVAL_DELAY ? "arrive" : "depart", + delayHumanTime, + ZonedDateTime + .ofInstant(targetDatetime.toInstant(), DateTimeUtils.getOtpZoneId()) + .format(DateTimeUtils.NOTIFICATION_TIME_FORMATTER) + ) ); - return notification; } /** @@ -85,12 +90,12 @@ public static TripMonitorNotification createDelayNotification( public static TripMonitorNotification createItineraryNotFoundNotification( boolean stillPossibleOnOtherMonitoredDaysOfTheWeek ) { - TripMonitorNotification notification = new TripMonitorNotification(); - notification.type = NotificationType.ITINERARY_NOT_FOUND; - notification.body = stillPossibleOnOtherMonitoredDaysOfTheWeek - ? "Your itinerary was not found in trip planner results for today! Please check realtime conditions and plan a new trip." - : "Your itinerary is no longer possible any monitored day of the week! Please plan and save a new trip."; - return notification; + return new TripMonitorNotification( + NotificationType.ITINERARY_NOT_FOUND, + stillPossibleOnOtherMonitoredDaysOfTheWeek + ? "Your itinerary was not found in trip planner results for today! Please check realtime conditions and plan a new trip." + : "Your itinerary is no longer possible any monitored day of the week! Please plan and save a new trip." + ); } /** @@ -100,8 +105,6 @@ public static TripMonitorNotification createInitialReminderNotification( MonitoredTrip trip, boolean noOtherNotifications ) { - TripMonitorNotification notification = new TripMonitorNotification(); - notification.type = NotificationType.INITIAL_REMINDER; // TODO: i18n and add itinerary details. StringBuilder body = new StringBuilder(); body.append(String.format("Reminder for your upcoming trip at %s.", trip.tripTime)); @@ -109,8 +112,10 @@ public static TripMonitorNotification createInitialReminderNotification( body.append(" "); body.append("We will let you know if anything changes."); } - notification.body = body.toString(); - return notification; + return new TripMonitorNotification( + NotificationType.INITIAL_REMINDER, + body.toString() + ); } private static String bodyFromAlerts( @@ -120,20 +125,20 @@ private static String bodyFromAlerts( { StringBuilder body = new StringBuilder(); // If all previous alerts were resolved and there are no unseen alerts, send ALL CLEAR. - if (previousAlerts.size() == resolvedAlerts.size() && unseenAlerts.size() == 0) { + if (previousAlerts.size() == resolvedAlerts.size() && unseenAlerts.isEmpty()) { body.append("All clear! The following alerts on your itinerary were all resolved:"); body.append(listFromAlerts(resolvedAlerts, true)); // Preempt the final return statement to avoid duplicating return body.toString(); } // If there are any unseen alerts, include list of these. - if (unseenAlerts.size() > 0) { + if (!unseenAlerts.isEmpty()) { // TODO: Improve message. body.append("New alerts found! They are:"); body.append(listFromAlerts(unseenAlerts, false)); } // If there are any resolved alerts, include list of these. - if (resolvedAlerts.size() > 0) { + if (!resolvedAlerts.isEmpty()) { if (body.length() > 0) body.append("\n"); // TODO: Improve message. body.append("Resolved alerts are:"); From e8adc1b09291ac7f4dc32c3f0feb61ff67b2762c Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Tue, 28 Nov 2023 15:22:29 -0500 Subject: [PATCH 04/11] improvement(CheckMonitoredTrip): Place initial reminder text at top of notifications. --- .../middleware/models/TripMonitorNotification.java | 4 ++++ .../middleware/tripmonitor/jobs/CheckMonitoredTrip.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java index aa30ab3f6..ca65e77a7 100644 --- a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java +++ b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java @@ -24,6 +24,10 @@ public TripMonitorNotification(NotificationType type, String body) { this.body = body; } + public int sortOrder() { + return type == NotificationType.INITIAL_REMINDER ? -100 : 0; + } + public static TripMonitorNotification createAlertNotification( Set previousAlerts, Set newAlerts) diff --git a/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java b/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java index 1516bb599..649109080 100644 --- a/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java +++ b/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java @@ -28,6 +28,7 @@ import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Collections; +import java.util.Comparator; import java.util.Date; import java.util.HashSet; import java.util.Map; @@ -423,10 +424,13 @@ private void sendNotifications() { LOG.info("Last notifications match current ones. Skipping notify."); return; } + Map templateData = Map.of( "tripId", trip.id, "tripName", trip.tripName, "notifications", notifications.stream() + // Make certain notifications, such as the initial reminder one, appear on top. + .sorted(Comparator.comparingInt(TripMonitorNotification::sortOrder)) .map(notification -> notification.body) .collect(Collectors.toList()) ); From 27efbf4e1f0a27efeefa75d46ec7bfbba85013e6 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Tue, 28 Nov 2023 15:46:41 -0500 Subject: [PATCH 05/11] improvement(TripMonitorNotifications): Improve notification text --- .../middleware/models/TripMonitorNotification.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java index ca65e77a7..f624ef7f2 100644 --- a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java +++ b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java @@ -109,12 +109,12 @@ public static TripMonitorNotification createInitialReminderNotification( MonitoredTrip trip, boolean noOtherNotifications ) { - // TODO: i18n and add itinerary details. + // TODO: i18n. StringBuilder body = new StringBuilder(); - body.append(String.format("Reminder for your upcoming trip at %s.", trip.tripTime)); + body.append(String.format("Reminder for %s at %s.", trip.tripName, trip.tripTime)); if (noOtherNotifications) { - body.append(" "); - body.append("We will let you know if anything changes."); + body.append("\n"); + body.append("We will notify you know if anything changes."); } return new TripMonitorNotification( NotificationType.INITIAL_REMINDER, @@ -137,15 +137,13 @@ private static String bodyFromAlerts( } // If there are any unseen alerts, include list of these. if (!unseenAlerts.isEmpty()) { - // TODO: Improve message. - body.append("New alerts found! They are:"); + body.append("\uD83D\uDD14 New alerts found:\n"); body.append(listFromAlerts(unseenAlerts, false)); } // If there are any resolved alerts, include list of these. if (!resolvedAlerts.isEmpty()) { if (body.length() > 0) body.append("\n"); - // TODO: Improve message. - body.append("Resolved alerts are:"); + body.append("Resolved alerts:"); body.append(listFromAlerts(resolvedAlerts, true)); } return body.toString(); From d3e9b9fba9ed801e8cb9fd6b594342f42a27ce84 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Wed, 29 Nov 2023 15:05:32 -0500 Subject: [PATCH 06/11] refactor(TripMonitorNotification): Remove the initial reminder text about "We'll let you know..." --- .../middleware/models/TripMonitorNotification.java | 11 ++--------- .../tripmonitor/jobs/CheckMonitoredTrip.java | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java index f624ef7f2..82de2e9bf 100644 --- a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java +++ b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java @@ -106,19 +106,12 @@ public static TripMonitorNotification createItineraryNotFoundNotification( * Creates an initial reminder of the itinerary monitoring. */ public static TripMonitorNotification createInitialReminderNotification( - MonitoredTrip trip, - boolean noOtherNotifications + MonitoredTrip trip ) { // TODO: i18n. - StringBuilder body = new StringBuilder(); - body.append(String.format("Reminder for %s at %s.", trip.tripName, trip.tripTime)); - if (noOtherNotifications) { - body.append("\n"); - body.append("We will notify you know if anything changes."); - } return new TripMonitorNotification( NotificationType.INITIAL_REMINDER, - body.toString() + String.format("Reminder for %s at %s.", trip.tripName, trip.tripTime) ); } diff --git a/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java b/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java index 649109080..8e26f39a3 100644 --- a/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java +++ b/src/main/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTrip.java @@ -142,7 +142,7 @@ private void addInitialReminderIfNeeded() { if (!trip.isInactive() && isFirstTimeCheckWithinLeadMonitoringTime && userWantsInitialReminder) { enqueueNotification( - TripMonitorNotification.createInitialReminderNotification(trip, notifications.isEmpty()) + TripMonitorNotification.createInitialReminderNotification(trip) ); } } From 7264908f03bff34a7ba0a311bf61cc567b4939ea Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Wed, 29 Nov 2023 15:23:41 -0500 Subject: [PATCH 07/11] test(TripMonitorNotification): Add test file for sort order. --- .../models/TripMonitorNotificationTest.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/test/java/org/opentripplanner/middleware/models/TripMonitorNotificationTest.java diff --git a/src/test/java/org/opentripplanner/middleware/models/TripMonitorNotificationTest.java b/src/test/java/org/opentripplanner/middleware/models/TripMonitorNotificationTest.java new file mode 100644 index 000000000..a8692b376 --- /dev/null +++ b/src/test/java/org/opentripplanner/middleware/models/TripMonitorNotificationTest.java @@ -0,0 +1,34 @@ +package org.opentripplanner.middleware.models; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +import org.junit.jupiter.api.Test; +import org.opentripplanner.middleware.tripmonitor.jobs.NotificationType; + +import java.util.Comparator; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +class TripMonitorNotificationTest { + @Test + void testSortOrderPutsInitialReminderFirst() { + TripMonitorNotification reminder = new TripMonitorNotification(NotificationType.INITIAL_REMINDER, "reminder"); + Set notifications = Set.of( + new TripMonitorNotification(NotificationType.ALERT_FOUND, "alert"), + new TripMonitorNotification(NotificationType.DEPARTURE_DELAY, "departure delay"), + reminder, + new TripMonitorNotification(NotificationType.ARRIVAL_DELAY, "arrival delay") + ); + + List sortedNotifications = notifications.stream() + .sorted(Comparator.comparingInt(TripMonitorNotification::sortOrder)) + .collect(Collectors.toList()); + + assertEquals(reminder, sortedNotifications.get(0)); + for (int i = 1; i < sortedNotifications.size(); i++) { + assertNotEquals(reminder, sortedNotifications.get(i)); + } + } +} From 20b65d1a9993f72384e8a3bf85e43960fff52c66 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Wed, 29 Nov 2023 15:30:30 -0500 Subject: [PATCH 08/11] refactor(TripMonitorNotification): Add comment for comparator/sort function. --- .../middleware/models/TripMonitorNotification.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java index 82de2e9bf..273115270 100644 --- a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java +++ b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java @@ -24,6 +24,10 @@ public TripMonitorNotification(NotificationType type, String body) { this.body = body; } + /** + * Basic comparator that sets an arbitrary lower rank for initial reminders, + * so that they appear before other notifications after list sorting. + */ public int sortOrder() { return type == NotificationType.INITIAL_REMINDER ? -100 : 0; } From 58abc2030d6d6fa9dea5021222b30a3e39426ebf Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 30 Nov 2023 11:10:03 -0500 Subject: [PATCH 09/11] Apply suggestions from code review Co-authored-by: Adriana Ceric <62163307+AdrianaCeric@users.noreply.github.com> --- .../middleware/models/TripMonitorNotification.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java index 273115270..4009d6707 100644 --- a/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java +++ b/src/main/java/org/opentripplanner/middleware/models/TripMonitorNotification.java @@ -101,8 +101,8 @@ public static TripMonitorNotification createItineraryNotFoundNotification( return new TripMonitorNotification( NotificationType.ITINERARY_NOT_FOUND, stillPossibleOnOtherMonitoredDaysOfTheWeek - ? "Your itinerary was not found in trip planner results for today! Please check realtime conditions and plan a new trip." - : "Your itinerary is no longer possible any monitored day of the week! Please plan and save a new trip." + ? "Your itinerary was not found in today's trip planner results. Please check real-time conditions and plan a new trip." + : "Your itinerary is no longer possible on any monitored day of the week. Please plan and save a new trip." ); } From 576262415fae02d8676dfec8a71c8fe285b3b7f4 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 30 Nov 2023 12:01:46 -0500 Subject: [PATCH 10/11] test(CheckMonitoredTripTest): Update tests with new notifi text. --- .../middleware/tripmonitor/jobs/CheckMonitoredTripTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTripTest.java b/src/test/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTripTest.java index e84e3dae4..990e778a2 100644 --- a/src/test/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTripTest.java +++ b/src/test/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTripTest.java @@ -505,7 +505,7 @@ public void canMakeOTPRequestAndResolveUnmatchedItinerary() throws Exception { "A notification should be generated for the next trip not being possible" ); assertEquals( - "Your itinerary was not found in trip planner results for today! Please check realtime conditions and plan a new trip.", + "Your itinerary was not found in today's trip planner results! Please check real-time conditions and plan a new trip.", mockCheckMonitoredTrip.notifications.iterator().next().body, "The notification should have the appropriate message when the next trip is not possible" ); @@ -585,7 +585,7 @@ public void canMakeOTPRequestAndResolveNoLongerPossibleTrip() throws Exception { "A notification should be generated for the next trip not being possible" ); assertEquals( - "Your itinerary is no longer possible any monitored day of the week! Please plan and save a new trip.", + "Your itinerary is no longer possible on any monitored day of the week! Please plan and save a new trip.", mockCheckMonitoredTrip.notifications.iterator().next().body, "The notification should have the appropriate message when the trip is no longer possible" ); From 142d6fb7138c9b97a7f991dd13e748a35ac2bfc1 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 30 Nov 2023 12:11:50 -0500 Subject: [PATCH 11/11] test(CheckMonitoredTripTest): Remove exclamation points --- .../middleware/tripmonitor/jobs/CheckMonitoredTripTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTripTest.java b/src/test/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTripTest.java index 990e778a2..a6128a712 100644 --- a/src/test/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTripTest.java +++ b/src/test/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTripTest.java @@ -505,7 +505,7 @@ public void canMakeOTPRequestAndResolveUnmatchedItinerary() throws Exception { "A notification should be generated for the next trip not being possible" ); assertEquals( - "Your itinerary was not found in today's trip planner results! Please check real-time conditions and plan a new trip.", + "Your itinerary was not found in today's trip planner results. Please check real-time conditions and plan a new trip.", mockCheckMonitoredTrip.notifications.iterator().next().body, "The notification should have the appropriate message when the next trip is not possible" ); @@ -585,7 +585,7 @@ public void canMakeOTPRequestAndResolveNoLongerPossibleTrip() throws Exception { "A notification should be generated for the next trip not being possible" ); assertEquals( - "Your itinerary is no longer possible on any monitored day of the week! Please plan and save a new trip.", + "Your itinerary is no longer possible on any monitored day of the week. Please plan and save a new trip.", mockCheckMonitoredTrip.notifications.iterator().next().body, "The notification should have the appropriate message when the trip is no longer possible" );