@Test
public void testFindByType() throws Exception {

  HostConfigMapping source = createEntity(1L, "h1", "global", "v1");
  HostEntity hostEntity = hostDAO.findByName("h1");
  
  Set<HostConfigMapping> target = hostConfigMappingDAO.findByType(1L, hostEntity.getHostId(), "global");
  Assert.assertEquals("Expected one result", 1, target.size());
  
  for (HostConfigMapping item : target) 
    Assert.assertEquals("Expected version 'v1'", source.getVersion(), item.getVersion());
}