@Test
  public void testFindByHost() {
    Assert.assertEquals(1, hostVersionDAO.findByHost("test_host1").size());
    Assert.assertEquals(1, hostVersionDAO.findByHost("test_host2").size());
    Assert.assertEquals(1, hostVersionDAO.findByHost("test_host3").size());

    addMoreVersions();

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