@Test
public void testRegisterHostWithConfigGroup_registerWithExistingConfigGroup() throws Exception {

  // test specific expectations
  expect(cluster.getConfigGroups()).andReturn(configGroups).once();
  expect(configGroup1.getHosts()).andReturn(Collections.singletonMap(2L, host2)).once();
  configGroup1.addHost(host1);
  // replay all mocks
  replayAll();
  // test
  context.registerHostWithConfigGroup(HOST1, topology, HOST_GROUP_1);
}