diff --git a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/inbound/FtpStreamingMessageSourceTests.java b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/inbound/FtpStreamingMessageSourceTests.java index 7954be4db7..2aa678d5a2 100644 --- a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/inbound/FtpStreamingMessageSourceTests.java +++ b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/inbound/FtpStreamingMessageSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThat; import java.io.InputStream; +import java.util.Comparator; import org.apache.commons.net.ftp.FTPFile; import org.junit.Test; @@ -35,6 +36,7 @@ import org.springframework.integration.annotation.Transformer; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.config.EnableIntegration; import org.springframework.integration.core.MessageSource; +import org.springframework.integration.file.remote.FileInfo; import org.springframework.integration.file.remote.session.SessionFactory; import org.springframework.integration.ftp.FtpTestSupport; import org.springframework.integration.ftp.filters.FtpPersistentAcceptOnceFileListFilter; @@ -93,7 +95,8 @@ public class FtpStreamingMessageSourceTests extends FtpTestSupport { @Bean @InboundChannelAdapter(channel = "stream") public MessageSource ftpMessageSource() { - FtpStreamingMessageSource messageSource = new FtpStreamingMessageSource(template(), null); + FtpStreamingMessageSource messageSource = new FtpStreamingMessageSource(template(), + Comparator.comparing(FileInfo::getFilename)); messageSource.setRemoteDirectory("ftpSource/"); messageSource.setFilter(new FtpPersistentAcceptOnceFileListFilter(new SimpleMetadataStore(), "streaming")); return messageSource; diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/inbound/SftpStreamingMessageSourceTests.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/inbound/SftpStreamingMessageSourceTests.java index 49dc3d92b4..5ebe4e6704 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/inbound/SftpStreamingMessageSourceTests.java +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/inbound/SftpStreamingMessageSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThat; import java.io.InputStream; +import java.util.Comparator; import org.junit.Test; import org.junit.runner.RunWith; @@ -34,6 +35,7 @@ import org.springframework.integration.annotation.Transformer; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.config.EnableIntegration; import org.springframework.integration.core.MessageSource; +import org.springframework.integration.file.remote.FileInfo; import org.springframework.integration.file.remote.session.SessionFactory; import org.springframework.integration.metadata.SimpleMetadataStore; import org.springframework.integration.scheduling.PollerMetadata; @@ -94,7 +96,8 @@ public class SftpStreamingMessageSourceTests extends SftpTestSupport { @Bean @InboundChannelAdapter(channel = "stream") public MessageSource ftpMessageSource() { - SftpStreamingMessageSource messageSource = new SftpStreamingMessageSource(template(), null); + SftpStreamingMessageSource messageSource = new SftpStreamingMessageSource(template(), + Comparator.comparing(FileInfo::getFilename)); messageSource.setRemoteDirectory("sftpSource/"); messageSource.setFilter(new SftpPersistentAcceptOnceFileListFilter(new SimpleMetadataStore(), "streaming")); return messageSource;