assertFalse(notifications.isEmpty());
}
@Test
public void save() {
Notification notification = new Notification();
notification.addEvent("save");
AttributeCond fullnameLeafCond1 = new AttributeCond(AttributeCond.Type.LIKE);
fullnameLeafCond1.setSchema("fullname");
fullnameLeafCond1.setExpression("%o%");
AttributeCond fullnameLeafCond2 = new AttributeCond(AttributeCond.Type.LIKE);
fullnameLeafCond2.setSchema("fullname");
fullnameLeafCond2.setExpression("%i%");
NodeCond about = NodeCond.getAndCond(NodeCond.getLeafCond(fullnameLeafCond1), NodeCond.getLeafCond(
fullnameLeafCond2));
notification.setAbout(about);
MembershipCond membCond = new MembershipCond();
membCond.setRoleId(7L);
NodeCond recipients = NodeCond.getLeafCond(membCond);
notification.setRecipients(recipients);
notification.setRecipientAttrName("email");
notification.setRecipientAttrType(IntMappingType.UserSchema);
notification.setSender("syncope@syncope.apache.org");
notification.setSubject("Test notification");
notification.setTemplate("test");
Notification actual = notificationDAO.save(notification);
assertNotNull(actual);
assertNotNull(actual.getId());
}