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 1832ded0ad1ece969a7525555cdd42a56ca3d2eb..c7a5560641597c16c35e915a97926510518dd490 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 b6f9488e0a6ff7af20672719271cda04026e0bf6..441131ea3508bb17ef46f2f154d0d2df04aa8637 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 f02be746c026b88f5441efce4b049e69699419ec..1447874e1835f4e8709fd82c0473c64d03a97e16 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 a44566565093d648d1ff2b3846efebe46813e721..d5f61c5695eb0c05337981f866b9f902be0d1139 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); }