Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

Commit ca48b68

Browse files
authored
Merge pull request #124 from pontusmelke/update-jline
Update version of jline
2 parents 7c26ee3 + b5112fb commit ca48b68

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@ ext {
7575
neo4jJavaVersion = '1.6.1'
7676
findbugsVersion = '3.0.0'
7777
jansiVersion = '1.13'
78-
jlineVersion = '2.14.2'
78+
jlineVersion = '2.14.6'
7979
mockitoVersion = '1.9.5'
8080
}

cypher-shell/src/integration-test/java/org/neo4j/shell/MainIntegrationTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class MainIntegrationTest {
1919
public void connectInteractivelyPromptsOnWrongAuthentication() throws Exception {
2020
// given
2121
// what the user inputs when prompted
22-
String inputString = "neo4j\nneo\n";
22+
String inputString = String.format( "neo4j%nneo%n" );
2323
InputStream inputStream = new ByteArrayInputStream(inputString.getBytes());
2424

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

6060
String out = baos.toString();
61-
assertEquals( "username: neo4j\r\n" +
62-
"password: ***\r\n", out );
61+
assertEquals( String.format( "username: neo4j%npassword: ***%n" ), out );
6362
}
6463
}

cypher-shell/src/test/java/org/neo4j/shell/MainTest.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void connectMaybeInteractivelyPromptsForBothIfNone() throws Exception {
8888

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

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

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)