This is an automated email from the ASF dual-hosted git repository. fmariani pushed a commit to branch camel-spring-boot-4.0.0-branch in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
commit 7798b4bf38ba09dbac915692fc20e7e9a92c372d Author: Marco Carletti <[email protected]> AuthorDate: Thu Sep 7 14:29:11 2023 +0200 CSB-2196: fix ftp tests --- components-starter/camel-ftp-starter/pom.xml | 7 +++++++ .../camel/component/file/remote/springboot/sftp/BaseSftp.java | 1 - .../file/remote/springboot/sftp/SftpKeyExchangeProtocolsTest.java | 4 ++-- .../remote/springboot/sftp/SftpSimpleProduceThroughProxyTest.java | 5 ++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/components-starter/camel-ftp-starter/pom.xml b/components-starter/camel-ftp-starter/pom.xml index ac8091474ea..a29466de4e2 100644 --- a/components-starter/camel-ftp-starter/pom.xml +++ b/components-starter/camel-ftp-starter/pom.xml @@ -88,6 +88,13 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + <version>20.0</version> + <!-- necessary to littleproxy --> + <scope>test</scope> + </dependency> <!--START OF GENERATED CODE--> <dependency> <groupId>org.apache.camel.springboot</groupId> diff --git a/components-starter/camel-ftp-starter/src/test/java/org/apache/camel/component/file/remote/springboot/sftp/BaseSftp.java b/components-starter/camel-ftp-starter/src/test/java/org/apache/camel/component/file/remote/springboot/sftp/BaseSftp.java index 2eacd4c458f..10a4e1de4b1 100644 --- a/components-starter/camel-ftp-starter/src/test/java/org/apache/camel/component/file/remote/springboot/sftp/BaseSftp.java +++ b/components-starter/camel-ftp-starter/src/test/java/org/apache/camel/component/file/remote/springboot/sftp/BaseSftp.java @@ -17,7 +17,6 @@ package org.apache.camel.component.file.remote.springboot.sftp; import org.apache.camel.component.file.remote.springboot.AbstractBaseFtp; -import org.apache.camel.component.file.remote.springboot.ftp.FtpEmbeddedService; import org.junit.jupiter.api.extension.RegisterExtension; import java.nio.file.Path; diff --git a/components-starter/camel-ftp-starter/src/test/java/org/apache/camel/component/file/remote/springboot/sftp/SftpKeyExchangeProtocolsTest.java b/components-starter/camel-ftp-starter/src/test/java/org/apache/camel/component/file/remote/springboot/sftp/SftpKeyExchangeProtocolsTest.java index 125f3e05d9e..d70bf80aab8 100644 --- a/components-starter/camel-ftp-starter/src/test/java/org/apache/camel/component/file/remote/springboot/sftp/SftpKeyExchangeProtocolsTest.java +++ b/components-starter/camel-ftp-starter/src/test/java/org/apache/camel/component/file/remote/springboot/sftp/SftpKeyExchangeProtocolsTest.java @@ -22,10 +22,10 @@ import org.apache.camel.EndpointInject; import org.apache.camel.Exchange; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.file.remote.springboot.ftp.BaseFtp; -import org.apache.camel.component.file.remote.springboot.ftp.FtpAnonymousTest; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.test.spring.junit5.CamelSpringBootTest; +import org.hamcrest.core.StringContains; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterAll; @@ -91,7 +91,7 @@ public class SftpKeyExchangeProtocolsTest extends BaseSftp { exception = exception.getCause(); } - MatcherAssert.assertThat(errorMessages, Matchers.hasItem("Algorithm negotiation fail")); + MatcherAssert.assertThat(errorMessages, Matchers.hasItem(StringContains.containsString("Algorithm negotiation fail"))); } @Test diff --git a/components-starter/camel-ftp-starter/src/test/java/org/apache/camel/component/file/remote/springboot/sftp/SftpSimpleProduceThroughProxyTest.java b/components-starter/camel-ftp-starter/src/test/java/org/apache/camel/component/file/remote/springboot/sftp/SftpSimpleProduceThroughProxyTest.java index 1bb356978a9..8c765cb0d92 100644 --- a/components-starter/camel-ftp-starter/src/test/java/org/apache/camel/component/file/remote/springboot/sftp/SftpSimpleProduceThroughProxyTest.java +++ b/components-starter/camel-ftp-starter/src/test/java/org/apache/camel/component/file/remote/springboot/sftp/SftpSimpleProduceThroughProxyTest.java @@ -45,7 +45,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; classes = { CamelAutoConfiguration.class, SftpSimpleProduceThroughProxyTest.class, - SftpSimpleProduceThroughProxyTest.TestConfiguration.class + SftpSimpleProduceThroughProxyTest.ProxyConfiguration.class } ) //Based on SftpSimpleProduceThroughProxyIT @@ -134,7 +134,10 @@ public class SftpSimpleProduceThroughProxyTest extends BaseSftp { } }; } + } + @Configuration + public class ProxyConfiguration { @Bean(value = "proxy") public ProxyHTTP createProxy() {
