Package io.skodjob.testframe.executor
Class ExecBuilder
java.lang.Object
io.skodjob.testframe.executor.ExecBuilder
Builder class for creating and executing commands.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexec()Executes the command with the provided configuration.logToOutput(boolean logToOutput) Sets whether to log the output of the command.throwErrors(boolean throwErrors) Sets whether to throw errors if the command fails.timeout(int timeout) Sets the timeout for the command.withCommand(String... cmd) Sets the command to execute.withCommand(List<String> command) Sets the command to execute.withEnvVars(Set<io.fabric8.kubernetes.api.model.EnvVar> envVars) Sets the environment variables.Sets the input for the command.
-
Constructor Details
-
ExecBuilder
public ExecBuilder()Constructor
-
-
Method Details
-
withCommand
Sets the command to execute.- Parameters:
command- The command to execute.- Returns:
- The ExecBuilder instance.
-
withCommand
Sets the command to execute.- Parameters:
cmd- The command to execute.- Returns:
- The ExecBuilder instance.
-
withEnvVars
Sets the environment variables.- Parameters:
envVars- The environment variables.- Returns:
- The ExecBuilder instance.
-
withInput
Sets the input for the command.- Parameters:
input- The input for the command.- Returns:
- The ExecBuilder instance.
-
logToOutput
Sets whether to log the output of the command.- Parameters:
logToOutput- Whether to log the output.- Returns:
- The ExecBuilder instance.
-
throwErrors
Sets whether to throw errors if the command fails.- Parameters:
throwErrors- Whether to throw errors.- Returns:
- The ExecBuilder instance.
-
timeout
Sets the timeout for the command.- Parameters:
timeout- The timeout for the command.- Returns:
- The ExecBuilder instance.
-
exec
Executes the command with the provided configuration.- Returns:
- The execution result.
-