@Test
  public void testRemoveCurrenyByHost() throws Exception {
    List<AlertCurrentEntity> currentAlerts = m_dao.findCurrent();
    assertNotNull(currentAlerts);
    assertEquals(5, currentAlerts.size());

    // there is no h2 host
    m_dao.removeCurrentByHost("h2");
    currentAlerts = m_dao.findCurrent();
    assertEquals(5, currentAlerts.size());

    // there is an h1 host
    m_dao.removeCurrentByHost("h1");
    currentAlerts = m_dao.findCurrent();
    assertEquals(0, currentAlerts.size());
  }
Tests that JPA does the sorting work for us.

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertsDAOTest.java