INT-4495: Fix SFTP tests
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.integration.sftp.inbound;
|
||||
|
||||
import static org.hamcrest.Matchers.anyOf;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertThat;
|
||||
@@ -49,7 +50,8 @@ public class SftpMessageSourceTests extends SftpTestSupport {
|
||||
SftpInboundFileSynchronizingMessageSource messageSource = buildSource();
|
||||
Message<?> received = messageSource.receive();
|
||||
assertNotNull(received);
|
||||
assertThat(received.getHeaders().get(FileHeaders.FILENAME), equalTo(" sftpSource1.txt"));
|
||||
assertThat(received.getHeaders().get(FileHeaders.FILENAME),
|
||||
anyOf(equalTo(" sftpSource1.txt"), equalTo("sftpSource2.txt")));
|
||||
}
|
||||
|
||||
private SftpInboundFileSynchronizingMessageSource buildSource() throws Exception {
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.integration.sftp.inbound;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
import static org.hamcrest.Matchers.anyOf;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertThat;
|
||||
@@ -124,7 +125,8 @@ public class SftpStreamingMessageSourceTests extends SftpTestSupport {
|
||||
messageSource.afterPropertiesSet();
|
||||
Message<InputStream> received = messageSource.receive();
|
||||
assertNotNull(received);
|
||||
assertThat(received.getHeaders().get(FileHeaders.REMOTE_FILE), equalTo(" sftpSource1.txt"));
|
||||
assertThat(received.getHeaders().get(FileHeaders.REMOTE_FILE),
|
||||
anyOf(equalTo(" sftpSource1.txt"), equalTo("sftpSource2.txt")));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -134,7 +136,8 @@ public class SftpStreamingMessageSourceTests extends SftpTestSupport {
|
||||
messageSource.afterPropertiesSet();
|
||||
Message<InputStream> received = messageSource.receive();
|
||||
assertNotNull(received);
|
||||
assertThat(received.getHeaders().get(FileHeaders.REMOTE_FILE), equalTo(" sftpSource1.txt"));
|
||||
assertThat(received.getHeaders().get(FileHeaders.REMOTE_FILE),
|
||||
anyOf(equalTo(" sftpSource1.txt"), equalTo("sftpSource2.txt")));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -144,7 +147,8 @@ public class SftpStreamingMessageSourceTests extends SftpTestSupport {
|
||||
messageSource.afterPropertiesSet();
|
||||
Message<InputStream> received = messageSource.receive();
|
||||
assertNotNull(received);
|
||||
assertThat(received.getHeaders().get(FileHeaders.REMOTE_FILE), equalTo(" sftpSource1.txt"));
|
||||
assertThat(received.getHeaders().get(FileHeaders.REMOTE_FILE),
|
||||
anyOf(equalTo(" sftpSource1.txt"), equalTo("sftpSource2.txt")));
|
||||
}
|
||||
|
||||
private SftpStreamingMessageSource buildSource() {
|
||||
|
||||
Reference in New Issue
Block a user