Class ExecBuilder

java.lang.Object
io.skodjob.testframe.executor.ExecBuilder

public class ExecBuilder extends Object
Builder class for creating and executing commands.
  • Constructor Details

    • ExecBuilder

      public ExecBuilder()
      Constructor
  • Method Details

    • withCommand

      public ExecBuilder withCommand(List<String> command)
      Sets the command to execute.
      Parameters:
      command - The command to execute.
      Returns:
      The ExecBuilder instance.
    • withCommand

      public ExecBuilder withCommand(String... cmd)
      Sets the command to execute.
      Parameters:
      cmd - The command to execute.
      Returns:
      The ExecBuilder instance.
    • withEnvVars

      public ExecBuilder withEnvVars(Set<io.fabric8.kubernetes.api.model.EnvVar> envVars)
      Sets the environment variables.
      Parameters:
      envVars - The environment variables.
      Returns:
      The ExecBuilder instance.
    • withInput

      public ExecBuilder withInput(String input)
      Sets the input for the command.
      Parameters:
      input - The input for the command.
      Returns:
      The ExecBuilder instance.
    • logToOutput

      public ExecBuilder logToOutput(boolean logToOutput)
      Sets whether to log the output of the command.
      Parameters:
      logToOutput - Whether to log the output.
      Returns:
      The ExecBuilder instance.
    • throwErrors

      public ExecBuilder throwErrors(boolean throwErrors)
      Sets whether to throw errors if the command fails.
      Parameters:
      throwErrors - Whether to throw errors.
      Returns:
      The ExecBuilder instance.
    • timeout

      public ExecBuilder timeout(int timeout)
      Sets the timeout for the command.
      Parameters:
      timeout - The timeout for the command.
      Returns:
      The ExecBuilder instance.
    • exec

      public ExecResult exec()
      Executes the command with the provided configuration.
      Returns:
      The execution result.