diff --git a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/validator/NotificationValidator.java b/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/validator/NotificationValidator.java index 24d528c63e..c691e79693 100644 --- a/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/validator/NotificationValidator.java +++ b/tx-cucumber-tests/src/test/java/org/eclipse/tractusx/traceability/test/validator/NotificationValidator.java @@ -65,18 +65,16 @@ public static void assertHasFields(NotificationResponse notification, Map messages; - public Optional latestNotification() { + public Optional latestMessage() { return messages.stream().max(Comparator.comparing(NotificationMessageResponse::getMessageDate)).stream().findFirst(); }