@Test
public void testAssignForValidHostGroup() {

  Map<String, List<String>> map = new HashMap<String, List<String>>();
  map.put("group1", new ArrayList<String>());
  ReflectionTestUtils.setField(clusterCommands, "hostGroups", map);
  when(client.getHostNames()).thenReturn(singletonMap("host3", "HEALTHY"));
  String result = clusterCommands.assign(new Host("host3"), "group1");
  assertEquals("host3 has been added to group1", result);
}