Search in sources :

Example 11 with Notification

use of org.apache.syncope.core.persistence.api.entity.Notification in project syncope by apache.

the class NotificationTest method issueSYNCOPE445.

@Test
public void issueSYNCOPE445() {
    Notification notification = entityFactory.newEntity(Notification.class);
    notification.getEvents().add("save");
    AnyAbout about = entityFactory.newEntity(AnyAbout.class);
    about.setNotification(notification);
    notification.add(about);
    about.setAnyType(anyTypeDAO.findUser());
    about.set("fake search condition");
    notification.setRecipientsFIQL("fake search condition");
    notification.setRecipientAttrName("email");
    notification.getStaticRecipients().add("syncope445@syncope.apache.org");
    notification.setSender("syncope@syncope.apache.org");
    notification.setSubject("Test notification");
    notification.setTemplate(mailTemplateDAO.find("test"));
    Notification actual = notificationDAO.save(notification);
    assertNotNull(actual);
    assertNotNull(actual.getKey());
    assertNotNull(actual.getStaticRecipients());
    assertFalse(actual.getStaticRecipients().isEmpty());
}
Also used : AnyAbout(org.apache.syncope.core.persistence.api.entity.AnyAbout) Notification(org.apache.syncope.core.persistence.api.entity.Notification) Test(org.junit.jupiter.api.Test) AbstractTest(org.apache.syncope.core.persistence.jpa.AbstractTest)

Aggregations

Notification (org.apache.syncope.core.persistence.api.entity.Notification)11 AnyAbout (org.apache.syncope.core.persistence.api.entity.AnyAbout)4 AbstractTest (org.apache.syncope.core.persistence.jpa.AbstractTest)4 Test (org.junit.jupiter.api.Test)4 NotFoundException (org.apache.syncope.core.persistence.api.dao.NotFoundException)3 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)3 SyncopeClientException (org.apache.syncope.common.lib.SyncopeClientException)2 NotificationTO (org.apache.syncope.common.lib.to.NotificationTO)2 AnyType (org.apache.syncope.core.persistence.api.entity.AnyType)2 MailTemplate (org.apache.syncope.core.persistence.api.entity.MailTemplate)2 ParseException (java.text.ParseException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Matcher (java.util.regex.Matcher)1 StringUtils (org.apache.commons.lang3.StringUtils)1 Pair (org.apache.commons.lang3.tuple.Pair)1 SyncopeConstants (org.apache.syncope.common.lib.SyncopeConstants)1 AnyObjectTO (org.apache.syncope.common.lib.to.AnyObjectTO)1 GroupTO (org.apache.syncope.common.lib.to.GroupTO)1