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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ ext {
neo4jJavaVersion = '1.6.1'
findbugsVersion = '3.0.0'
jansiVersion = '1.13'
jlineVersion = '2.14.2'
jlineVersion = '2.14.6'
mockitoVersion = '1.9.5'
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class MainIntegrationTest {
public void connectInteractivelyPromptsOnWrongAuthentication() throws Exception {
// given
// what the user inputs when prompted
String inputString = "neo4j\nneo\n";
String inputString = String.format( "neo4j%nneo%n" );
InputStream inputStream = new ByteArrayInputStream(inputString.getBytes());

ByteArrayOutputStream baos = new ByteArrayOutputStream();
Expand Down Expand Up @@ -58,7 +58,6 @@ public void connectInteractivelyPromptsOnWrongAuthentication() throws Exception
assertEquals("neo", connectionConfig.password());

String out = baos.toString();
assertEquals( "username: neo4j\r\n" +
"password: ***\r\n", out );
assertEquals( String.format( "username: neo4j%npassword: ***%n" ), out );
}
}
11 changes: 5 additions & 6 deletions cypher-shell/src/test/java/org/neo4j/shell/MainTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void connectMaybeInteractivelyPromptsForBothIfNone() throws Exception {

String out = new String(baos.toByteArray(), StandardCharsets.UTF_8);

assertEquals(out, "username: bob\r\npassword: ******\r\n");
assertEquals( out, String.format( "username: bob%npassword: ******%n" ));
verify(connectionConfig).setUsername("bob");
verify(connectionConfig).setPassword("secret");
verify(shell, times(2)).connect(connectionConfig);
Expand Down Expand Up @@ -130,7 +130,7 @@ public void connectMaybeInteractivelyPromptsForUserIfPassExists() throws Excepti

String out = new String(baos.toByteArray(), StandardCharsets.UTF_8);

assertEquals(out, "username: bob\r\n");
assertEquals(out, String.format( "username: bob%n" ));
verify(connectionConfig).setUsername("bob");
verify(shell, times(2)).connect(connectionConfig);
}
Expand All @@ -151,7 +151,7 @@ public void connectMaybeInteractivelyPromptsForPassIfUserExists() throws Excepti

String out = new String(baos.toByteArray(), StandardCharsets.UTF_8);

assertEquals(out, "password: ******\r\n");
assertEquals(out, String.format("password: ******%n"));
verify(connectionConfig).setPassword("secret");
verify(shell, times(2)).connect(connectionConfig);
}
Expand All @@ -171,7 +171,7 @@ public void connectMaybeInteractivelyPromptsHandlesBang() throws Exception {

String out = new String(baos.toByteArray(), StandardCharsets.UTF_8);

assertEquals(out, "username: bo!b\r\npassword: *******\r\n");
assertEquals(out, String.format("username: bo!b%npassword: *******%n"));
verify(connectionConfig).setUsername("bo!b");
verify(connectionConfig).setPassword("sec!ret");
verify(shell, times(2)).connect(connectionConfig);
Expand Down Expand Up @@ -214,8 +214,7 @@ public void connectMaybeInteractivelyRepromptsIfUserIsNotProvided() throws Excep

String out = new String(baos.toByteArray(), StandardCharsets.UTF_8);

assertEquals(out, "username: \r\nusername cannot be empty" + System.lineSeparator() + System.lineSeparator() +
"username: bob\r\npassword: ******\r\n");
assertEquals(out, String.format( "username: %nusername cannot be empty%n%nusername: bob%npassword: ******%n") );
verify(connectionConfig).setUsername("bob");
verify(connectionConfig).setPassword("secret");
verify(shell, times(2)).connect(connectionConfig);
Expand Down