File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
src/test/java/com/github/stefanbirkner/fakesftpserver/rule Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 99 </parent >
1010
1111 <artifactId >fake-sftp-server-rule</artifactId >
12- <version >1.1.1 </version >
12+ <version >1.2.0-SNAPSHOT </version >
1313 <packaging >jar</packaging >
1414
1515 <name >Fake SFTP Server Rule</name >
Original file line number Diff line number Diff line change @@ -312,12 +312,7 @@ public void a_directory_that_is_created_with_the_rule_can_be_read_by_a_client()
312312 executeTestWithRule (
313313 () -> {
314314 sftpServer .createDirectory ("/a/directory" );
315- Session session = connectToServer (sftpServer );
316- ChannelSftp channel = connectSftpChannel (session );
317- Vector entries = channel .ls ("/a/directory" );
318- assertThat (entries ).hasSize (2 ); //these are the entries . and ..
319- channel .disconnect ();
320- session .disconnect ();
315+ assertEmptyDirectory (sftpServer , "/a/directory" );
321316 },
322317 sftpServer
323318 );
@@ -354,6 +349,18 @@ public void a_directory_cannot_be_created_after_the_test_is_finished() {
354349 + " started or is already finished."
355350 );
356351 }
352+
353+ private static void assertEmptyDirectory (
354+ FakeSftpServerRule sftpServer ,
355+ String directory
356+ ) throws JSchException , SftpException {
357+ Session session = connectToServer (sftpServer );
358+ ChannelSftp channel = connectSftpChannel (session );
359+ Vector entries = channel .ls (directory );
360+ assertThat (entries ).hasSize (2 ); //these are the entries . and ..
361+ channel .disconnect ();
362+ session .disconnect ();
363+ }
357364 }
358365
359366 @ RunWith (Enclosed .class )
You can’t perform that action at this time.
0 commit comments