Fix FTP Tests
Incorrect directory and the test didn't verify that files were retrieved.
This commit is contained in:
@@ -195,11 +195,13 @@ public class FtpServerOutboundTests {
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testInt2866LocalDirectoryExpressionMGET() {
|
||||
String dir = "ftpSource/";
|
||||
this.inboundMGet.send(new GenericMessage<Object>("*.txt"));
|
||||
this.inboundMGet.send(new GenericMessage<Object>(dir + "*.txt"));
|
||||
Message<?> result = this.output.receive(1000);
|
||||
assertNotNull(result);
|
||||
List<File> localFiles = (List<File>) result.getPayload();
|
||||
|
||||
assertThat(localFiles.size(), Matchers.greaterThan(0));
|
||||
|
||||
for (File file : localFiles) {
|
||||
assertThat(file.getPath().replaceAll(java.util.regex.Matcher.quoteReplacement(File.separator), "/"),
|
||||
Matchers.containsString(dir));
|
||||
@@ -211,6 +213,8 @@ public class FtpServerOutboundTests {
|
||||
assertNotNull(result);
|
||||
localFiles = (List<File>) result.getPayload();
|
||||
|
||||
assertThat(localFiles.size(), Matchers.greaterThan(0));
|
||||
|
||||
for (File file : localFiles) {
|
||||
assertThat(file.getPath().replaceAll(java.util.regex.Matcher.quoteReplacement(File.separator), "/"),
|
||||
Matchers.containsString(dir));
|
||||
@@ -229,6 +233,8 @@ public class FtpServerOutboundTests {
|
||||
assertNotNull(result);
|
||||
List<File> localFiles = (List<File>) result.getPayload();
|
||||
|
||||
assertThat(localFiles.size(), Matchers.greaterThan(0));
|
||||
|
||||
for (File file : localFiles) {
|
||||
assertThat(file.getName(), isOneOf("localTarget1.txt", "localTarget2.txt"));
|
||||
assertThat(file.getName(), not(containsString("null")));
|
||||
|
||||
@@ -188,6 +188,8 @@ public class SftpServerOutboundTests {
|
||||
assertNotNull(result);
|
||||
List<File> localFiles = (List<File>) result.getPayload();
|
||||
|
||||
assertThat(localFiles.size(), Matchers.greaterThan(0));
|
||||
|
||||
for (File file : localFiles) {
|
||||
assertThat(file.getPath().replaceAll(java.util.regex.Matcher.quoteReplacement(File.separator), "/"),
|
||||
Matchers.containsString(dir));
|
||||
@@ -199,6 +201,8 @@ public class SftpServerOutboundTests {
|
||||
assertNotNull(result);
|
||||
localFiles = (List<File>) result.getPayload();
|
||||
|
||||
assertThat(localFiles.size(), Matchers.greaterThan(0));
|
||||
|
||||
for (File file : localFiles) {
|
||||
assertThat(file.getPath().replaceAll(java.util.regex.Matcher.quoteReplacement(File.separator), "/"),
|
||||
Matchers.containsString(dir));
|
||||
|
||||
Reference in New Issue
Block a user