### Question:
InteractiveShellClient { public void launchShell(final ShellConfiguration configuration) throws IOException { final Terminal terminal = configuration.buildTerminal(); try (Interpreter interpreter = this.initializeInterpreter(terminal)) { final Shell shell = new Shell(interpreter); final LineReader lineReader = configuration.buildLineReader(terminal, shell.getCommands()); final String prompt = configuration.buildPrompt(terminal); shell.run(lineReader, prompt); } }  void launchShell(final ShellConfiguration configuration);  }### Answer:
@Test public void run_mockConfiguration() throws IOException { final ShellConfiguration configuration = Mockito.mock(ShellConfiguration.class); final Terminal terminal = Mockito.mock(DumbTerminal.class); final StringWriter output = new StringWriter(); final PrintWriter printWriter = new PrintWriter(output); Mockito.when(terminal.writer()).thenReturn(printWriter); final LineReader lineReader = Mockito.mock(LineReader.class); Mockito.when(lineReader.readLine("prompt")).thenReturn("help", "exit"); Mockito.when(configuration.buildTerminal()).thenReturn(terminal); Mockito.when(configuration.buildPrompt(terminal)).thenReturn("prompt"); Mockito.when(configuration.buildLineReader(Mockito.eq(terminal), ArgumentMatchers.anyCollection())) .thenReturn(lineReader); final InteractiveShellClient shellClient = new InteractiveShellClient(); shellClient.launchShell(configuration); assertTrue(output.toString().contains("Welcome to the Rulewerk interactive shell.")); assertTrue(output.toString().contains("Available commands:")); assertTrue(output.toString().contains("Exiting Rulewerk")); }