Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ public void switchingToSystemDatabaseWorks() throws CommandException {
assertOnSystemDB();
}

@Test
public void switchingToSystemDatabaseIsNotCaseSensitive() throws CommandException {
useCommand.execute("SyStEm");

assertThat(linePrinter.output(), is(""));
assertOnSystemDB();
}

@Test
public void switchingToSystemDatabaseAndBackToNeo4jWorks() throws CommandException {
useCommand.execute(SYSTEM_DB_NAME);
Expand Down Expand Up @@ -100,7 +108,7 @@ public void switchingDatabaseAfterRollbackTransactionWorks() throws CommandExcep
@Test
public void switchingToNonExistingDatabaseShouldGiveErrorResponseFromServer() throws CommandException {
thrown.expect(ClientException.class);
thrown.expectMessage("The database requested does not exist.");
thrown.expectMessage("Database does not exist");

useCommand.execute("this_database_name_does_not_exist_in_test_container");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private void reconnect(boolean keepBookmark) {
};
session = driver.session(sessionArgs.andThen(sessionOptionalArgs));

String query = activeDatabaseNameAsSetByUser.equals(SYSTEM_DB_NAME) ? "SHOW DATABASES" : "RETURN 1";
String query = activeDatabaseNameAsSetByUser.compareToIgnoreCase(SYSTEM_DB_NAME) == 0 ? "SHOW DATABASES" : "RETURN 1";

resetActualDbName(); // Set this to null first in case run throws an exception
StatementResult run = session.run(query);
Expand Down