From 0560261f607612729d2ca9c33601621386545410 Mon Sep 17 00:00:00 2001 From: OZGCloud <ozgcloud@mgm-tp.com> Date: Thu, 27 Oct 2022 13:59:45 +0200 Subject: [PATCH] OZG-3065 rename --- .../notification/user/UserNotificationEventListener.java | 2 +- .../kop/notification/user/UserNotificationService.java | 9 +++++---- .../user/UserNotificationEventListenerTest.java | 2 +- .../notification/user/UserNotificationServiceTest.java | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/notification-manager/src/main/java/de/itvsh/kop/notification/user/UserNotificationEventListener.java b/notification-manager/src/main/java/de/itvsh/kop/notification/user/UserNotificationEventListener.java index 1832ded0a..c7a556064 100644 --- a/notification-manager/src/main/java/de/itvsh/kop/notification/user/UserNotificationEventListener.java +++ b/notification-manager/src/main/java/de/itvsh/kop/notification/user/UserNotificationEventListener.java @@ -21,6 +21,6 @@ public class UserNotificationEventListener { @EventListener public void onVorgangCreated(VorgangCreatedEvent event) { var organisationeinheitId = vorgangService.getVorgang(VorgangId.from(event.getSource())).getOrganisationseinheitenId(); - userNotificationService.notify(organisationeinheitId); + userNotificationService.sendNotification(organisationeinheitId); } } diff --git a/notification-manager/src/main/java/de/itvsh/kop/notification/user/UserNotificationService.java b/notification-manager/src/main/java/de/itvsh/kop/notification/user/UserNotificationService.java index b6f9488e0..441131ea3 100644 --- a/notification-manager/src/main/java/de/itvsh/kop/notification/user/UserNotificationService.java +++ b/notification-manager/src/main/java/de/itvsh/kop/notification/user/UserNotificationService.java @@ -1,11 +1,12 @@ package de.itvsh.kop.notification.user; -import de.itvsh.kop.notification.email.EmailRemoteService; -import de.itvsh.kop.notification.email.UserEmail; +import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.List; +import de.itvsh.kop.notification.email.EmailRemoteService; +import de.itvsh.kop.notification.email.UserEmail; @Service public class UserNotificationService { @@ -19,7 +20,7 @@ public class UserNotificationService { @Autowired private UserRemoteService userRemoteService; - public void notify(String organisationeinheitId) { + public void sendNotification(String organisationeinheitId) { var recipients = userRemoteService.getRecipients(organisationeinheitId); emailRemoteService.sendEmail(buildUserEmail(recipients)); } diff --git a/notification-manager/src/test/java/de/itvsh/kop/notification/user/UserNotificationEventListenerTest.java b/notification-manager/src/test/java/de/itvsh/kop/notification/user/UserNotificationEventListenerTest.java index f02be746c..1447874e1 100644 --- a/notification-manager/src/test/java/de/itvsh/kop/notification/user/UserNotificationEventListenerTest.java +++ b/notification-manager/src/test/java/de/itvsh/kop/notification/user/UserNotificationEventListenerTest.java @@ -48,7 +48,7 @@ class UserNotificationEventListenerTest { void shouldNotifyWithOrganisationeinheitIds() { userNotificationEventListener.onVorgangCreated(EVENT); - verify(userNotificationService).notify(VorgangTestFactory.ORGANISATIONEINCHEIT_ID); + verify(userNotificationService).sendNotification(VorgangTestFactory.ORGANISATIONEINCHEIT_ID); } } } \ No newline at end of file diff --git a/notification-manager/src/test/java/de/itvsh/kop/notification/user/UserNotificationServiceTest.java b/notification-manager/src/test/java/de/itvsh/kop/notification/user/UserNotificationServiceTest.java index a44566565..d5f61c569 100644 --- a/notification-manager/src/test/java/de/itvsh/kop/notification/user/UserNotificationServiceTest.java +++ b/notification-manager/src/test/java/de/itvsh/kop/notification/user/UserNotificationServiceTest.java @@ -40,14 +40,14 @@ class UserNotificationServiceTest { @Test void shouldGetRecipients() { - userNotificationService.notify(ORGANISATIONEINCHEIT_ID); + userNotificationService.sendNotification(ORGANISATIONEINCHEIT_ID); verify(userRemoteService).getRecipients(ORGANISATIONEINCHEIT_ID); } @Test void shouldSendEmail() { - userNotificationService.notify(ORGANISATIONEINCHEIT_ID); + userNotificationService.sendNotification(ORGANISATIONEINCHEIT_ID); verify(emailRemoteService).sendEmail(USER_EMAIL); } -- GitLab