use of org.neo4j.shell.UserMessagesHandler in project neo4j by neo4j.
the class InteractiveShellRunnerTest method setup.
@Before
public void setup() throws Exception {
statementParser = new ShellStatementParser();
logger = mock(Logger.class);
cmdExecuter = mock(StatementExecuter.class);
txHandler = mock(TransactionHandler.class);
databaseManager = mock(DatabaseManager.class);
connectionConfig = mock(ConnectionConfig.class);
historyFile = temp.newFile();
badLineError = new ClientException("Found a bad line");
userMessagesHandler = mock(UserMessagesHandler.class);
when(databaseManager.getActualDatabaseAsReportedByServer()).thenReturn("mydb");
when(userMessagesHandler.getWelcomeMessage()).thenReturn("Welcome to cypher-shell!");
when(userMessagesHandler.getExitMessage()).thenReturn("Exit message");
when(connectionConfig.username()).thenReturn("myusername");
doThrow(badLineError).when(cmdExecuter).execute(contains("bad"));
doReturn(System.out).when(logger).getOutputStream();
}
Aggregations