@Test
  public void testFindByCluster() {
    Assert.assertEquals(3, hostVersionDAO.findByCluster("test_cluster1").size());

    addMoreVersions();

    Assert.assertEquals(9, hostVersionDAO.findByCluster("test_cluster1").size());
  }
Test the {@link HostVersionDAO#findByCluster(String)} method.
ambari-server/src/test/java/org/apache/ambari/server/orm/dao/HostVersionDAOTest.java