Package org.springframework.shell.test
Class ShellTestClient
java.lang.Object
org.springframework.shell.test.ShellTestClient
Client for shell session which can be used as a programmatic way to interact with a
shell application. In a typical test, it is required to send a command to the shell as
if a user typed it and then verify the shell output.
- Author:
- Janne Valkealahti, Mahmoud Ben Hassine
-
Constructor Summary
ConstructorsConstructorDescriptionShellTestClient(CommandParser commandParser, CommandRegistry commandRegistry) -
Method Summary
Modifier and TypeMethodDescriptionsendCommand(String input) Execute a command and write its result to the shell screen.
-
Constructor Details
-
ShellTestClient
- Parameters:
commandParser- the command parsercommandRegistry- the command registry
-
-
Method Details
-
sendCommand
Execute a command and write its result to the shell screen.- Parameters:
input- the raw input command- Returns:
- the shell screen after command execution
- Throws:
Exception- if an error occurred during command execution
-