Skip to content

Commit

Permalink
Merge pull request #1061 from eclipse-tractusx/feature/962-notificati…
Browse files Browse the repository at this point in the history
…on-model-update

feature(refactoring):962 refactored e2e-test.
  • Loading branch information
ds-mmaul authored Jun 19, 2024
2 parents b59952c + 5a83f89 commit 7c5a7fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,16 @@ public static void assertHasFields(NotificationResponse notification, Map<String
}

if (fieldsToCheck.containsKey(CLOSE_REASON.getFieldName())) {
assertThat(notification.getReason().close())
.isEqualTo(fieldsToCheck.get(CLOSE_REASON.getFieldName()));
assertThat(notification.latestMessage().get().getMessage()).isEqualTo(fieldsToCheck.get(CLOSE_REASON.getFieldName()));
}

if (fieldsToCheck.containsKey(ACCEPT_REASON.getFieldName())) {
assertThat(notification.getReason().accept())
.isEqualTo(fieldsToCheck.get(ACCEPT_REASON.getFieldName()));
assertThat(notification.latestMessage().get().getMessage()).isEqualTo(fieldsToCheck.get(ACCEPT_REASON.getFieldName()));

}

if (fieldsToCheck.containsKey(DECLINE_REASON.getFieldName())) {
assertThat(notification.getReason().decline())
.isEqualTo(fieldsToCheck.get(DECLINE_REASON.getFieldName()));
assertThat(notification.latestMessage().get().getMessage()).isEqualTo(fieldsToCheck.get(DECLINE_REASON.getFieldName()));
}

if (fieldsToCheck.containsKey(SEVERITY.getFieldName())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public class NotificationResponse {
private List<NotificationMessageResponse> messages;


public Optional<NotificationMessageResponse> latestNotification() {
public Optional<NotificationMessageResponse> latestMessage() {
return messages.stream().max(Comparator.comparing(NotificationMessageResponse::getMessageDate)).stream().findFirst();
}

Expand Down

0 comments on commit 7c5a7fc

Please sign in to comment.