Skip to content
Snippets Groups Projects
Commit 3b27e8cf authored by OZGCloud's avatar OZGCloud
Browse files

OZG-2626 OZG-3065 cleanup

parent 19e3a382
Branches
Tags
No related merge requests found
...@@ -6,12 +6,10 @@ import java.util.Objects; ...@@ -6,12 +6,10 @@ import java.util.Objects;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import de.itvsh.kop.notification.email.EmailRemoteService; import de.itvsh.kop.notification.email.EmailRemoteService;
import de.itvsh.kop.notification.email.UserEmail; import de.itvsh.kop.notification.email.UserEmail;
@Validated
@Service @Service
public class UserNotificationService { public class UserNotificationService {
......
package de.itvsh.ozg.pluto.vorgang;
import static org.assertj.core.api.Assertions.*;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
import javax.validation.ConstraintViolationException;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.MockBean;
import de.itvsh.kop.common.test.ITCase;
import de.itvsh.kop.notification.user.UserNotificationEventListener;
import de.itvsh.kop.notification.vorgang.Vorgang;
import de.itvsh.kop.notification.vorgang.VorgangId;
import de.itvsh.kop.notification.vorgang.VorgangService;
import de.itvsh.ozg.pluto.command.VorgangCreatedEvent;
@ITCase
public class UserNotificationITCase {
@Autowired
private UserNotificationEventListener notificationListener;
@MockBean
private VorgangService vorgangService;
@DisplayName("Send notification")
@Nested
class TestSendNotification {
@Test
void shouldThrowConstraintViolationExceptionOnMissingOrgaIds() {
when(vorgangService.getVorgang(any(VorgangId.class))).thenReturn(Vorgang.builder().organisationseinheitenId(null).build());
var vorgangCreatedEvent = new VorgangCreatedEvent(VorgangTestFactory.ID.toString());
assertThatThrownBy(() -> notificationListener.onVorgangCreated(vorgangCreatedEvent)).isInstanceOf(ConstraintViolationException.class);
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment