@Test
public void testFindNoticeByUuid() throws Exception {

  List<AlertDefinitionEntity> definitions = createDefinitions();
  AlertDefinitionEntity definition = definitions.get(0);
  AlertHistoryEntity history = new AlertHistoryEntity();
  history.setServiceName(definition.getServiceName());
  history.setClusterId(m_cluster.getClusterId());
  history.setAlertDefinition(definition);
  history.setAlertLabel("Label");
  history.setAlertState(AlertState.OK);
  history.setAlertText("Alert Text");
  history.setAlertTimestamp(System.currentTimeMillis());
  m_alertsDao.create(history);
  AlertTargetEntity target = m_helper.createAlertTarget();
  AlertNoticeEntity notice = new AlertNoticeEntity();
  notice.setUuid(UUID.randomUUID().toString());
  notice.setAlertTarget(target);
  notice.setAlertHistory(history);
  notice.setNotifyState(NotificationState.PENDING);
  m_dao.create(notice);
  AlertNoticeEntity actual = m_dao.findNoticeByUuid(notice.getUuid());
  assertEquals(notice.getNotificationId(), actual.getNotificationId());
  assertNull(m_dao.findNoticeByUuid("DEADBEEF"));
}