@Test
public void shouldCommandParametersBeSet() throws Exception {

  // GIVEN
  Map<String, Cluster> clsMap = new HashMap<>();
  clsMap.put("test-cluster", clusterMock);
  Map<String, String> configMap = new HashMap<>();
  configMap.put("hdfs_user", "hdfs-test-user");
  EasyMock.expect(clusterMock.getClusterId()).andReturn(1l);
  EasyMock.expect(clusterMock.getClusterName()).andReturn("test-cluster");
  EasyMock.expect(clusterMock.getSecurityType()).andReturn(SecurityType.NONE).times(3);
  EasyMock.expect(clusterMock.getDesiredConfigByType("hadoop-env")).andReturn(configMock);
  EasyMock.expect(configMock.getProperties()).andReturn(configMap);
  EasyMock.expect(actionManagerMock.getNextRequestId()).andReturn(1l);
  EasyMock.expect(clustersMock.getClusters()).andReturn(clsMap);
  EasyMock.expect(configurationMock.getServerTempDir()).andReturn("/var/lib/ambari-server/tmp").times(2);
  EasyMock.expect(configurationMock.getProperty(Configuration.POST_USER_CREATION_HOOK)).andReturn("/var/lib/ambari-server/resources/scripts/post-user-creation-hook.sh").anyTimes();
  EasyMock.expect(objectMapperMock.writeValueAsString(((PostUserCreationHookContext) userCreatedEvent.getContext()).getUserGroups())).andReturn("{testUser=[hdfs, yarn]}");
  stageMock.setStageId(-1);
  // TBD refine expectations to validate the logic / eg capture arguments
  stageMock.addServerActionCommand(EasyMock.anyString(), EasyMock.anyString(), EasyMock.anyObject(Role.class), EasyMock.anyObject(RoleCommand.class), EasyMock.anyString(), EasyMock.anyObject(ServiceComponentHostServerActionEvent.class),
      EasyMock.<Map<String, String>>anyObject(), EasyMock.anyString(), EasyMock.<Map<String, Map<String, String>>>anyObject(), EasyMock.anyInt(), EasyMock.anyBoolean(), EasyMock.anyBoolean());
  EasyMock.expect(requestFactoryMock.createNewFromStages(Arrays.asList(stageMock))).andReturn(null);
  EasyMock.expect(stageFactoryMock.createNew(1, "/var/lib/ambari-server/tmp:1", "test-cluster", 1, "Post user creation hook for [ 1 ] users", "{}", "{}", "{}")).andReturn(stageMock);
  replayAll();
  //WHEN
  hookService.onUserCreatedEvent(userCreatedEvent);
  //THEN
  // TBD assertions on the captured arguments!
}