@Test(expected = AmbariException.class)
  public void shouldServerActionFailWhenCommandParametersAreMissing() throws Exception {
    //GIVEN
    Map<String, String> commandParams = new HashMap<>();
    // the execution command lacks the required command parameters (commandparams is an empty list)
    EasyMock.expect(executionCommand.getCommandParams()).andReturn(commandParams).times(2);

    customScriptServerAction.setExecutionCommand(executionCommand);
    replayAll();

    // WHEN
    CommandReport commandReport = customScriptServerAction.execute(requestSharedDataContext);

    //THEN
    //exception is thrown
  }
Test suite for the PostUserCreationHookServer action class.
ambari-server/src/test/java/org/apache/ambari/server/serveraction/users/PostUserCreationHookServerActionTest.java