@Test
public void testFindByState() {

  List<AlertState> allStates = new ArrayList<AlertState>();
  allStates.add(AlertState.OK);
  allStates.add(AlertState.WARNING);
  allStates.add(AlertState.CRITICAL);
  List<AlertHistoryEntity> history = m_dao.findAll(m_cluster.getClusterId(),
      allStates);
  assertNotNull(history);
  assertEquals(50, history.size());
  history = m_dao.findAll(m_cluster.getClusterId(),
      Collections.singletonList(AlertState.OK));
  assertNotNull(history);
  assertEquals(40, history.size());
  history = m_dao.findAll(m_cluster.getClusterId(),
      Collections.singletonList(AlertState.CRITICAL));
  assertNotNull(history);
  assertEquals(10, history.size());
  history = m_dao.findAll(m_cluster.getClusterId(),
      Collections.singletonList(AlertState.WARNING));
  assertNotNull(history);
  assertEquals(0, history.size());
}