@Test
public void testAutoAssign() throws InvalidHostGroupHostAssociation {

  Map<String, List<String>> hostGroups = singletonMap("group1", asList("host1"));
  Map<String, List<String>> newAssignments = singletonMap("group1", asList("host1"));
  ReflectionTestUtils.setField(clusterCommands, "hostGroups", hostGroups);
  when(context.getFocusValue()).thenReturn("blueprint");
  when(client.recommendAssignments("blueprint")).thenReturn(newAssignments);
  clusterCommands.autoAssign();
  Map<String, List<String>> result = (Map<String, List<String>>) ReflectionTestUtils.getField(clusterCommands, "hostGroups");
  assertEquals(newAssignments, result);
  verify(context).setHint(Hints.CREATE_CLUSTER);
}