Skip to content

Commit 0630709

Browse files
committed
Upgrade to SSHD 2.9.3
* Fix `SftpRemoteFileTemplateTests` according to new SSHD requirements (restrictions?)
1 parent e21de19 commit 0630709

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ ext {
4747
modifiedFiles =
4848
files(grgit.status().unstaged.modified).filter { f -> f.name.endsWith('.java') || f.name.endsWith('.kt') }
4949

50-
apacheSshdVersion = '2.9.2'
50+
apacheSshdVersion = '2.9.3'
5151
artemisVersion = '2.28.0'
5252
aspectjVersion = '1.9.20.1'
5353
assertjVersion = '3.24.2'

spring-integration-sftp/src/test/java/org/springframework/integration/sftp/session/SftpRemoteFileTemplateTests.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2023 the original author or authors.
2+
* Copyright 2014-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -71,14 +71,14 @@ public void testINT3412AppendStatRmdir() {
7171
fileNameGenerator.setExpression("'foobar.txt'");
7272
fileNameGenerator.setBeanFactory(mock(BeanFactory.class));
7373
template.setFileNameGenerator(fileNameGenerator);
74-
template.setRemoteDirectoryExpression(new LiteralExpression("foo/"));
74+
template.setRemoteDirectoryExpression(new LiteralExpression("/foo/"));
7575
template.setUseTemporaryFileName(false);
7676
template.setBeanFactory(mock(BeanFactory.class));
7777
template.afterPropertiesSet();
7878

7979
template.execute(session -> {
80-
session.mkdir("foo/");
81-
return session.mkdir("foo/bar/");
80+
session.mkdir("/foo");
81+
return session.mkdir("/foo/bar");
8282
});
8383
template.append(new GenericMessage<>("foo"));
8484
template.append(new GenericMessage<>("bar"));
@@ -93,17 +93,17 @@ public void testINT3412AppendStatRmdir() {
9393
}
9494
});
9595
template.execute((SessionCallbackWithoutResult<SftpClient.DirEntry>) session -> {
96-
SftpClient.DirEntry[] files = session.list("foo/");
96+
SftpClient.DirEntry[] files = session.list("/foo");
9797
assertThat(files.length).isEqualTo(4);
98-
assertThat(session.remove("foo/foobar.txt")).isTrue();
99-
assertThat(session.rmdir("foo/bar/")).isTrue();
100-
files = session.list("foo/");
98+
assertThat(session.remove("/foo/foobar.txt")).isTrue();
99+
assertThat(session.rmdir("/foo/bar")).isTrue();
100+
files = session.list("/foo");
101101
assertThat(files.length).isEqualTo(2);
102102
List<String> fileNames = Arrays.stream(files).map(SftpClient.DirEntry::getFilename).toList();
103103
assertThat(fileNames).contains(".", "..");
104-
assertThat(session.rmdir("foo/")).isTrue();
104+
assertThat(session.rmdir("/foo")).isTrue();
105105
});
106-
assertThat(template.exists("foo")).isFalse();
106+
assertThat(template.exists("/foo")).isFalse();
107107
}
108108

109109
@Test

0 commit comments

Comments
 (0)