Package org.springframework.shell.test
Interface ShellTestClient
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
ShellTestClient.DefaultShellClient
Client for terminal session which can be used as a programmatic way
to interact with a shell application. In a typical test it is required
to write into a shell and read what is visible in a shell.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
static interface
Builder interface forShellClient
.static class
static class
static class
static class
static interface
static interface
static class
static final record
-
Method Summary
Modifier and TypeMethodDescriptionstatic ShellTestClient.Builder
builder
(TerminalSession terminalSession, Shell shell, PromptProvider promptProvider, org.jline.reader.LineReader lineReader, org.jline.terminal.Terminal terminal) Get an instance of a builder.Run interactive shell session.nonInterative
(String... args) Run non-interactive command session.screen()
Read the screen.
-
Method Details
-
interactive
ShellTestClient.InteractiveShellSession interactive()Run interactive shell session.- Returns:
- session for chaining
-
nonInterative
Run non-interactive command session.- Parameters:
args
- the command arguments- Returns:
- session for chaining
-
screen
ShellScreen screen()Read the screen.- Returns:
- the screen
-
builder
static ShellTestClient.Builder builder(TerminalSession terminalSession, Shell shell, PromptProvider promptProvider, org.jline.reader.LineReader lineReader, org.jline.terminal.Terminal terminal) Get an instance of a builder.- Parameters:
terminalSession
- the terminal sessionshell
- the shellpromptProvider
- the prompt providerlineReader
- the line readerterminal
- the terminal- Returns:
- a Builder
-