File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
spring-integration-ftp/src
main/java/org/springframework/integration/ftp/session
test/java/org/springframework/integration/ftp/session Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ public void close() {
153153 }
154154 }
155155 }
156+ this .client .logout ();
156157 this .client .disconnect ();
157158 }
158159 catch (Exception e ) {
@@ -196,7 +197,6 @@ public boolean rmdir(String directory) throws IOException {
196197 return this .client .removeDirectory (directory );
197198 }
198199
199-
200200 @ Override
201201 public boolean exists (String path ) throws IOException {
202202 Assert .hasText (path , "'path' must not be empty" );
Original file line number Diff line number Diff line change 4545 * @author Oleg Zhurakousky
4646 * @author Gunnar Hillert
4747 * @author Gary Russell
48+ * @author Artem Bilan
4849 *
4950 */
5051@ SuppressWarnings ({"rawtypes" , "unchecked" })
5152public class SessionFactoryTests {
5253
5354
5455 @ Test
55- public void testTimeouts () throws Exception {
56+ public void testFtpClientInteraction () throws Exception {
5657 final FTPClient client = mock (FTPClient .class );
5758 DefaultFtpSessionFactory sessionFactory = new DefaultFtpSessionFactory () {
5859
@@ -67,10 +68,15 @@ protected FTPClient createClientInstance() {
6768 sessionFactory .setDataTimeout (789 );
6869 doReturn (200 ).when (client ).getReplyCode ();
6970 doReturn (true ).when (client ).login ("foo" , null );
70- sessionFactory .getSession ();
71+ FtpSession session = sessionFactory .getSession ();
7172 verify (client ).setConnectTimeout (123 );
7273 verify (client ).setDefaultTimeout (456 );
7374 verify (client ).setDataTimeout (789 );
75+
76+ session .close ();
77+
78+ verify (client ).logout ();
79+ verify (client ).disconnect ();
7480 }
7581
7682 @ Test
You can’t perform that action at this time.
0 commit comments