@@ -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 \ n password: ******\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 \ n password: *******\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 \n username cannot be empty" + System .lineSeparator () + System .lineSeparator () +
218- "username: bob\r \n password: ******\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