}
@Test
public void issueSYNCOPE492() throws Exception {
// 1. create suitable disabled notification for subsequent tests
Notification notification = new Notification();
notification.addEvent("[REST]:[UserController]:[]:[create]:[SUCCESS]");
notification.setUserAbout(SyncopeClient.getUserSearchConditionBuilder().hasRoles(7L).query());
notification.setSelfAsRecipient(true);
notification.setRecipientAttrName("email");
notification.setRecipientAttrType(IntMappingType.UserSchema);
notification.getStaticRecipients().add("syncope492@syncope.apache.org");
Random random = new Random(System.currentTimeMillis());
String sender = "syncopetest-" + random.nextLong() + "@syncope.apache.org";
notification.setSender(sender);
String subject = "Test notification " + random.nextLong();
notification.setSubject(subject);
notification.setTemplate("optin");
notification.setActive(false);
Notification actual = notificationDAO.save(notification);
assertNotNull(actual);
notificationDAO.flush();
final int tasksNumberBefore = taskDAO.findAll(NotificationTask.class).size();