@Test
public void testFindByName() throws Exception {

  createConfigGroup("c1", "hdfs-1", "HDFS", "some description", null, null);
  ConfigGroupEntity configGroupEntity = configGroupDAO.findByName("hdfs-1");
  Long clusterId = clusterDAO.findByName("c1").getClusterId();
  Assert.assertNotNull(configGroupEntity);
  Assert.assertEquals("c1", configGroupEntity.getClusterEntity().getClusterName());
  Assert.assertEquals(clusterId, configGroupEntity.getClusterEntity()
    .getClusterId());
  Assert.assertEquals("hdfs-1", configGroupEntity.getGroupName());
  Assert.assertEquals("HDFS", configGroupEntity.getTag());
  Assert.assertEquals("some description", configGroupEntity.getDescription());
}