@Test
public void update_Success_Test() {
Calendar futureDate = Calendar.getInstance();
futureDate.add(Calendar.DATE, 1);
SystemNotification systemNotification = createSystemNotification(true, new Date(), futureDate.getTime(), "test message", SystemNotificationType.MAINTENANCE, SystemNotificationSeverity.INFO);
assertTrue(systemNotificationService.doesEntityExist(systemNotification.getId()));
Date updatedStartDate = systemNotification.getStartDate();
updatedStartDate.setTime(updatedStartDate.getTime() + 1000);
Date updatedEndDate = systemNotification.getEndDate();
updatedEndDate.setTime(updatedEndDate.getTime() + 1000);
systemNotification.setAllPages(!systemNotification.isAllPages());
systemNotification.setStartDate(updatedStartDate);
systemNotification.setEndDate(updatedEndDate);
systemNotification.setMessage("updated message");
systemNotification.setNotificationSeverity(SystemNotificationSeverity.ERROR);
systemNotificationService.update(systemNotification);
SystemNotification updatedSystemNotification = systemNotificationService.get(systemNotification.getId());
assertNotNull(updatedSystemNotification);
assertEquals(updatedSystemNotification.getStartDate(), systemNotification.getStartDate());
assertEquals(updatedSystemNotification.getEndDate(), systemNotification.getEndDate());
assertEquals(updatedSystemNotification.isAllPages(), systemNotification.isAllPages());
assertEquals(updatedSystemNotification.getMessage(), systemNotification.getMessage());
assertEquals(updatedSystemNotification.getNotificationType(), systemNotification.getNotificationType());
assertEquals(updatedSystemNotification.getNotificationSeverity(), systemNotification.getNotificationSeverity());
}