You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/08/19 10:01:17 UTC

[GitHub] [camel] Nayananga opened a new pull request #4101: Added testcontainer integration test for Minio

Nayananga opened a new pull request #4101:
URL: https://github.com/apache/camel/pull/4101


   I wanted to integrate testcontainer integration testing to this component. But I keep getting this error
   > Caused by: java.net.ConnectException: Failed to connect to /127.0.0.1:9000
   
   here I have attached the log
   ```
   2020-08-19 14:37:43,137 [main           ] INFO  CamelTestSupport               - ********************************************************************************
   2020-08-19 14:37:43,145 [main           ] INFO  CamelTestSupport               - Testing: sendInOnly()(org.apache.camel.component.minio.integration.testContainers.MinioComponentIntegrationTest)
   2020-08-19 14:37:43,145 [main           ] INFO  CamelTestSupport               - ********************************************************************************
   2020-08-19 14:37:43,357 [Thread-1       ] INFO  DockerClientProviderStrategy   - Loaded org.testcontainers.dockerclient.EnvironmentAndSystemPropertyClientProviderStrategy from ~/.testcontainers.properties, will try it first
   2020-08-19 14:37:44,685 [Thread-1       ] INFO  PropertyClientProviderStrategy - Found docker client settings from environment
   2020-08-19 14:37:44,685 [Thread-1       ] INFO  DockerClientProviderStrategy   - Found Docker environment with Environment variables, system properties and defaults. Resolved dockerHost=unix:///var/run/docker.sock
   2020-08-19 14:37:44,966 [Thread-1       ] INFO  DockerClientFactory            - Docker host IP address is localhost
   2020-08-19 14:37:45,012 [Thread-1       ] INFO  DockerClientFactory            - Connected to docker: 
     Server Version: 19.03.8
     API Version: 1.40
     Operating System: Ubuntu 20.04.1 LTS
     Total Memory: 15881 MB
   2020-08-19 14:37:45,095 [Thread-1       ] WARN  RegistryAuthLocator            - Failure when attempting to lookup auth config (dockerImageName: testcontainersofficial/ryuk:0.3.0, configFile: /home/nayananga/.docker/config.json. Falling back to docker-java default behaviour. Exception message: /home/nayananga/.docker/config.json (No such file or directory)
   2020-08-19 14:37:46,740 [Thread-1       ] INFO  DockerClientFactory            - Ryuk started - will monitor and terminate Testcontainers containers on JVM exit
   2020-08-19 14:37:46,740 [Thread-1       ] INFO  DockerClientFactory            - Checking the system...
   2020-08-19 14:37:46,742 [Thread-1       ] INFO  DockerClientFactory            - ✔︎ Docker server version should be at least 1.6.0
   2020-08-19 14:37:46,935 [Thread-1       ] INFO  DockerClientFactory            - ✔︎ Docker environment should have more than 2GB free disk space
   2020-08-19 14:37:46,948 [Thread-1       ] INFO  🐳 [minio/minio:latest]        - Creating container for image: minio/minio:latest
   2020-08-19 14:37:47,549 [Thread-1       ] INFO  🐳 [minio/minio:latest]        - Starting container with ID: e3587aa9bbe5f20a1a0df332523d75d7a4a8d581636961754070ab6a5c7b2b87
   2020-08-19 14:37:48,023 [Thread-1       ] INFO  🐳 [minio/minio:latest]        - Container minio/minio:latest is starting: e3587aa9bbe5f20a1a0df332523d75d7a4a8d581636961754070ab6a5c7b2b87
   2020-08-19 14:37:48,079 [Thread-1       ] INFO  HttpWaitStrategy               - /nifty_perlman: Waiting for 10 seconds for URL: http://localhost:32785/minio/health/ready
   2020-08-19 14:37:49,809 [tream-789982197] INFO  Containers                     - [tc-9EqZjVGT] STDOUT: 
   2020-08-19 14:37:49,810 [tream-789982197] INFO  Containers                     - [tc-9EqZjVGT] STDOUT:  You are running an older version of MinIO released 2 days ago 
   2020-08-19 14:37:49,811 [tream-789982197] INFO  Containers                     - [tc-9EqZjVGT] STDOUT:  Update: docker pull minio/minio:RELEASE.2020-08-18T19-41-00Z 
   2020-08-19 14:37:49,812 [tream-789982197] INFO  Containers                     - [tc-9EqZjVGT] STDOUT: 
   2020-08-19 14:37:49,812 [tream-789982197] INFO  Containers                     - [tc-9EqZjVGT] STDOUT: 
   2020-08-19 14:37:49,832 [tream-789982197] INFO  Containers                     - [tc-9EqZjVGT] STDOUT: Attempting encryption of all config, IAM users and policies on MinIO backend
   2020-08-19 14:37:50,116 [Thread-1       ] INFO  🐳 [minio/minio:latest]        - Container minio/minio:latest started in PT6.805S
   2020-08-19 14:37:50,183 [main           ] INFO  LRUCacheFactory                - Detected and using LRUCacheFactory: camel-caffeine-lrucache
   2020-08-19 14:37:50,770 [tream-789982197] INFO  Containers                     - [tc-9EqZjVGT] STDOUT: Endpoint:  http://172.17.0.3:9000  http://127.0.0.1:9000
   2020-08-19 14:37:50,771 [tream-789982197] INFO  Containers                     - [tc-9EqZjVGT] STDOUT: 
   2020-08-19 14:37:50,771 [tream-789982197] INFO  Containers                     - [tc-9EqZjVGT] STDOUT: Browser Access:
   2020-08-19 14:37:50,771 [tream-789982197] INFO  Containers                     - [tc-9EqZjVGT] STDOUT:    http://172.17.0.3:9000  http://127.0.0.1:9000
   2020-08-19 14:37:50,772 [tream-789982197] INFO  Containers                     - [tc-9EqZjVGT] STDOUT: 
   2020-08-19 14:37:50,772 [tream-789982197] INFO  Containers                     - [tc-9EqZjVGT] STDOUT: Object API (Amazon S3 compatible):
   2020-08-19 14:37:50,772 [tream-789982197] INFO  Containers                     - [tc-9EqZjVGT] STDOUT:    Go:         https://docs.min.io/docs/golang-client-quickstart-guide
   2020-08-19 14:37:50,773 [tream-789982197] INFO  Containers                     - [tc-9EqZjVGT] STDOUT:    Java:       https://docs.min.io/docs/java-client-quickstart-guide
   2020-08-19 14:37:50,774 [tream-789982197] INFO  Containers                     - [tc-9EqZjVGT] STDOUT:    Python:     https://docs.min.io/docs/python-client-quickstart-guide
   2020-08-19 14:37:50,775 [tream-789982197] INFO  Containers                     - [tc-9EqZjVGT] STDOUT:    JavaScript: https://docs.min.io/docs/javascript-client-quickstart-guide
   2020-08-19 14:37:50,776 [tream-789982197] INFO  Containers                     - [tc-9EqZjVGT] STDOUT:    .NET:       https://docs.min.io/docs/dotnet-client-quickstart-guide
   2020-08-19 14:37:50,937 [main           ] INFO  AbstractCamelContext           - Apache Camel  (camel-1) is starting
   2020-08-19 14:37:50,940 [main           ] INFO  AbstractCamelContext           - StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
   2020-08-19 14:37:50,940 [main           ] INFO  AbstractCamelContext           - Using HealthCheck: camel-health
   2020-08-19 14:37:51,161 [main           ] ERROR AbstractCamelContext           - Error starting CamelContext (camel-1) due to exception thrown: Failed to start route route1 because of null
   org.apache.camel.FailedToStartRouteException: Failed to start route route1 because of null
   	at org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:125) ~[classes/:?]
   	at org.apache.camel.impl.engine.InternalRouteStartupManager.doWarmUpRoutes(InternalRouteStartupManager.java:263) ~[classes/:?]
   	at org.apache.camel.impl.engine.InternalRouteStartupManager.safelyStartRouteServices(InternalRouteStartupManager.java:156) ~[classes/:?]
   	at org.apache.camel.impl.engine.InternalRouteStartupManager.doStartOrResumeRoutes(InternalRouteStartupManager.java:114) ~[classes/:?]
   	at org.apache.camel.impl.engine.AbstractCamelContext.doStartCamel(AbstractCamelContext.java:2833) ~[classes/:?]
   	at org.apache.camel.impl.engine.AbstractCamelContext.doStartContext(AbstractCamelContext.java:2674) ~[classes/:?]
   	at org.apache.camel.impl.engine.AbstractCamelContext.doStart(AbstractCamelContext.java:2637) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.start(BaseService.java:115) ~[classes/:?]
   	at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2450) ~[classes/:?]
   	at org.apache.camel.test.junit5.CamelTestSupport.startCamelContext(CamelTestSupport.java:731) ~[classes/:?]
   	at org.apache.camel.test.junit5.CamelTestSupport.doSetUp(CamelTestSupport.java:504) ~[classes/:?]
   	at org.apache.camel.test.junit5.CamelTestSupport.setUp(CamelTestSupport.java:379) ~[classes/:?]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_265]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_265]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_265]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_265]
   	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:686) ~[junit-platform-commons-1.6.2.jar:1.6.2]
   	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptLifecycleMethod(TimeoutExtension.java:126) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptBeforeEachMethod(TimeoutExtension.java:76) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeMethodInExtensionContext(ClassBasedTestDescriptor.java:481) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$synthesizeBeforeEachMethodAdapter$18(ClassBasedTestDescriptor.java:466) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeEachMethods$2(TestMethodTestDescriptor.java:169) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeMethodsOrCallbacksUntilExceptionOccurs$5(TestMethodTestDescriptor.java:197) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeBeforeMethodsOrCallbacksUntilExceptionOccurs(TestMethodTestDescriptor.java:197) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeBeforeEachMethods(TestMethodTestDescriptor.java:166) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:133) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:71) ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
   	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at java.util.ArrayList.forEach(ArrayList.java:1259) ~[?:1.8.0_265]
   	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at java.util.ArrayList.forEach(ArrayList.java:1259) ~[?:1.8.0_265]
   	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51) ~[junit-platform-engine-1.6.2.jar:1.6.2]
   	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:248) ~[junit-platform-launcher-1.6.2.jar:1.6.2]
   	at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$5(DefaultLauncher.java:211) ~[junit-platform-launcher-1.6.2.jar:1.6.2]
   	at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:226) [junit-platform-launcher-1.6.2.jar:1.6.2]
   	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:199) [junit-platform-launcher-1.6.2.jar:1.6.2]
   	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:132) [junit-platform-launcher-1.6.2.jar:1.6.2]
   	at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71) [junit5-rt.jar:?]
   	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) [junit-rt.jar:?]
   	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220) [junit-rt.jar:?]
   	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53) [junit-rt.jar:?]
   Caused by: org.apache.camel.RuntimeCamelException: java.net.ConnectException: Failed to connect to /127.0.0.1:9000
   	at org.apache.camel.RuntimeCamelException.wrapRuntimeException(RuntimeCamelException.java:68) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.doFail(BaseService.java:411) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.fail(BaseService.java:337) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.start(BaseService.java:127) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.processor.SendProcessor.doStart(SendProcessor.java:228) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.start(BaseService.java:115) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:101) ~[classes/:?]
   	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler.doStart(RedeliveryErrorHandler.java:1459) ~[classes/:?]
   	at org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:60) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:101) ~[classes/:?]
   	at org.apache.camel.processor.channel.DefaultChannel.doStart(DefaultChannel.java:143) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.start(BaseService.java:115) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:87) ~[classes/:?]
   	at org.apache.camel.processor.Pipeline.doStart(Pipeline.java:154) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.start(BaseService.java:115) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.support.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.start(BaseService.java:115) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.impl.engine.RouteService.startChildService(RouteService.java:334) ~[classes/:?]
   	at org.apache.camel.impl.engine.RouteService.doWarmUp(RouteService.java:184) ~[classes/:?]
   	at org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:123) ~[classes/:?]
   	... 78 more
   Caused by: java.net.ConnectException: Failed to connect to /127.0.0.1:9000
   	at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:265) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:183) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:224) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:108) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.java:88) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.connection.Transmitter.newExchange(Transmitter.java:169) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.RealCall.execute(RealCall.java:81) ~[okhttp-3.14.9.jar:?]
   	at io.minio.MinioClient.execute(MinioClient.java:1014) ~[minio-7.1.0.jar:7.1.0]
   	at io.minio.MinioClient.execute(MinioClient.java:935) ~[minio-7.1.0.jar:7.1.0]
   	at io.minio.MinioClient.executeHead(MinioClient.java:1204) ~[minio-7.1.0.jar:7.1.0]
   	at io.minio.MinioClient.bucketExists(MinioClient.java:3592) ~[minio-7.1.0.jar:7.1.0]
   	at org.apache.camel.component.minio.MinioEndpoint.bucketExists(MinioEndpoint.java:188) ~[classes/:?]
   	at org.apache.camel.component.minio.MinioEndpoint.doStart(MinioEndpoint.java:103) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.start(BaseService.java:115) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.processor.SendProcessor.doStart(SendProcessor.java:228) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.start(BaseService.java:115) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:101) ~[classes/:?]
   	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler.doStart(RedeliveryErrorHandler.java:1459) ~[classes/:?]
   	at org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:60) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:101) ~[classes/:?]
   	at org.apache.camel.processor.channel.DefaultChannel.doStart(DefaultChannel.java:143) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.start(BaseService.java:115) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:87) ~[classes/:?]
   	at org.apache.camel.processor.Pipeline.doStart(Pipeline.java:154) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.start(BaseService.java:115) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.support.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.start(BaseService.java:115) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.impl.engine.RouteService.startChildService(RouteService.java:334) ~[classes/:?]
   	at org.apache.camel.impl.engine.RouteService.doWarmUp(RouteService.java:184) ~[classes/:?]
   	at org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:123) ~[classes/:?]
   	... 78 more
   Caused by: java.net.ConnectException: Connection refused (Connection refused)
   	at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:1.8.0_265]
   	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[?:1.8.0_265]
   	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[?:1.8.0_265]
   	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[?:1.8.0_265]
   	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:1.8.0_265]
   	at java.net.Socket.connect(Socket.java:607) ~[?:1.8.0_265]
   	at okhttp3.internal.platform.Platform.connectSocket(Platform.java:130) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:263) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:183) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:224) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:108) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.java:88) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.connection.Transmitter.newExchange(Transmitter.java:169) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229) ~[okhttp-3.14.9.jar:?]
   	at okhttp3.RealCall.execute(RealCall.java:81) ~[okhttp-3.14.9.jar:?]
   	at io.minio.MinioClient.execute(MinioClient.java:1014) ~[minio-7.1.0.jar:7.1.0]
   	at io.minio.MinioClient.execute(MinioClient.java:935) ~[minio-7.1.0.jar:7.1.0]
   	at io.minio.MinioClient.executeHead(MinioClient.java:1204) ~[minio-7.1.0.jar:7.1.0]
   	at io.minio.MinioClient.bucketExists(MinioClient.java:3592) ~[minio-7.1.0.jar:7.1.0]
   	at org.apache.camel.component.minio.MinioEndpoint.bucketExists(MinioEndpoint.java:188) ~[classes/:?]
   	at org.apache.camel.component.minio.MinioEndpoint.doStart(MinioEndpoint.java:103) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.start(BaseService.java:115) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.processor.SendProcessor.doStart(SendProcessor.java:228) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.start(BaseService.java:115) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:101) ~[classes/:?]
   	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler.doStart(RedeliveryErrorHandler.java:1459) ~[classes/:?]
   	at org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:60) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:101) ~[classes/:?]
   	at org.apache.camel.processor.channel.DefaultChannel.doStart(DefaultChannel.java:143) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.start(BaseService.java:115) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:87) ~[classes/:?]
   	at org.apache.camel.processor.Pipeline.doStart(Pipeline.java:154) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.start(BaseService.java:115) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.support.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78) ~[classes/:?]
   	at org.apache.camel.support.service.BaseService.start(BaseService.java:115) ~[classes/:?]
   	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) ~[classes/:?]
   	at org.apache.camel.impl.engine.RouteService.startChildService(RouteService.java:334) ~[classes/:?]
   	at org.apache.camel.impl.engine.RouteService.doWarmUp(RouteService.java:184) ~[classes/:?]
   	at org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:123) ~[classes/:?]
   	... 78 more
   2020-08-19 14:37:51,170 [main           ] INFO  AbstractCamelContext           - Apache Camel  (camel-1) is shutting down
   2020-08-19 14:37:51,179 [main           ] INFO  AbstractCamelContext           - Apache Camel  (camel-1) uptime 0.241 seconds
   2020-08-19 14:37:51,179 [main           ] INFO  AbstractCamelContext           - Apache Camel  (camel-1) is shutdown in 0.009 seconds
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] omarsmak commented on pull request #4101: Added testcontainer integration test for Minio

Posted by GitBox <gi...@apache.org>.
omarsmak commented on pull request #4101:
URL: https://github.com/apache/camel/pull/4101#issuecomment-679074400


   @Nayananga but why don't you just create the bucket before the tests start in `@BeforeAll` and then delete the testing bucket in `@AfterAll`? You can see this example [here](https://github.com/apache/camel/blob/master/components/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/BlobProducerIT.java). 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] DenisIstomin commented on pull request #4101: Added testcontainer integration test for Minio

Posted by GitBox <gi...@apache.org>.
DenisIstomin commented on pull request #4101:
URL: https://github.com/apache/camel/pull/4101#issuecomment-678374169


   Hi @Nayananga,
   You could try to use this approach - `Singleton Containers` https://www.testcontainers.org/test_framework_integration/manual_lifecycle_control/
   So you can define an abstract class and inherit from it:
   ```
   abstract class AbstractContainerBaseTest {
   
       static final MySQLContainer MY_SQL_CONTAINER;
   
       static {
           MY_SQL_CONTAINER = new MySQLContainer();
           MY_SQL_CONTAINER.start();
       }
   }
   
   class FirstTest extends AbstractContainerBaseTest {
   
       @Test
       void someTestMethod() {
           String url = MY_SQL_CONTAINER.getJdbcUrl();
   
           // create a connection and run test as normal
       }
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] Nayananga commented on a change in pull request #4101: Added testcontainer integration test for Minio

Posted by GitBox <gi...@apache.org>.
Nayananga commented on a change in pull request #4101:
URL: https://github.com/apache/camel/pull/4101#discussion_r473064197



##########
File path: components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/testContainers/MinioComponentIntegrationTest.java
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.minio.integration.testContainers;
+
+import java.io.IOException;
+import java.time.Duration;
+import java.util.Properties;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.Message;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.minio.MinioConstants;
+import org.apache.camel.component.minio.integration.MinioTestUtils;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.testcontainers.junit5.ContainerAwareTestSupport;
+import org.junit.jupiter.api.Test;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.wait.strategy.HttpWaitStrategy;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+public class MinioComponentIntegrationTest extends ContainerAwareTestSupport {
+
+    final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
+    final int port = 9000;
+
+    @EndpointInject("direct:start")
+    private ProducerTemplate template;
+
+    @EndpointInject("mock:result")
+    private MockEndpoint result;
+
+    public MinioComponentIntegrationTest() throws IOException {
+    }
+
+    @Test
+    public void sendInOnly() throws Exception {
+        result.expectedMessageCount(1);
+
+        Exchange exchange1 = template.send("direct:start", ExchangePattern.InOnly, exchange -> {
+            exchange.getIn().setHeader(MinioConstants.OBJECT_NAME, "CamelUnitTest");
+            exchange.getIn().setBody("This is my bucket content.");
+        });
+
+        Exchange exchange2 = template.send("direct:start", ExchangePattern.InOnly, exchange -> {
+            exchange.getIn().setHeader(MinioConstants.OBJECT_NAME, "CamelUnitTest");
+            exchange.getIn().setBody("This is my bucket content.");
+        });
+
+        assertMockEndpointsSatisfied();
+
+        assertResultExchange(result.getExchanges().get(0));
+
+        assertResponseMessage(exchange1.getIn());
+        assertResponseMessage(exchange2.getIn());
+    }
+
+    @Test
+    public void sendInOut() throws Exception {
+        result.expectedMessageCount(1);
+
+        Exchange exchange = template.send("direct:start", ExchangePattern.InOut, exchange1 -> {
+            exchange1.getIn().setHeader(MinioConstants.OBJECT_NAME, "CamelUnitTest");
+            exchange1.getIn().setBody("This is my bucket content.");
+        });
+
+        assertMockEndpointsSatisfied();
+
+        assertResultExchange(result.getExchanges().get(0));
+
+        assertResponseMessage(exchange.getMessage());
+    }
+
+    private void assertResultExchange(Exchange resultExchange) {
+        assertEquals("This is my bucket content.", resultExchange.getIn().getBody(String.class));
+        assertEquals("mycamelbucket", resultExchange.getIn().getHeader(MinioConstants.BUCKET_NAME));
+        assertTrue(resultExchange.getIn().getHeader(MinioConstants.OBJECT_NAME, String.class).startsWith("CamelUnitTest"));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.VERSION_ID)); // not enabled on this bucket
+        assertNotNull(resultExchange.getIn().getHeader(MinioConstants.LAST_MODIFIED));
+        assertEquals("application/octet-stream", resultExchange.getIn().getHeader(MinioConstants.CONTENT_TYPE));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.CONTENT_ENCODING));
+        assertEquals(26L, resultExchange.getIn().getHeader(MinioConstants.CONTENT_LENGTH));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.CONTENT_DISPOSITION));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.CONTENT_MD5));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.CACHE_CONTROL));
+    }
+
+    private void assertResponseMessage(Message message) {
+        assertNull(message.getHeader(MinioConstants.VERSION_ID));
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            @Override
+            public void configure() {
+                String minioEndpointUri =
+                        "minio://mycamelbucket?accessKey=Q3AM3UQ867SPQQA43P2F&secretKey=RAW(zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG)&region=us-west-1&autoCreateBucket=true&endpoint=http://127.0.0.1&proxyPort=9000";

Review comment:
       @omarsmak sure I'll import them from a resource file, Any suggestions regarding above error?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] DenisIstomin commented on a change in pull request #4101: Added testcontainer integration test for Minio

Posted by GitBox <gi...@apache.org>.
DenisIstomin commented on a change in pull request #4101:
URL: https://github.com/apache/camel/pull/4101#discussion_r475276617



##########
File path: components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioComponentIntegrationTest.java
##########
@@ -33,18 +36,22 @@
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
+@Disabled("Goto https://play.min.io and search for 'mycamelbucket'. If bucket(s) does not exist, set 'autoCreateBucket=true' in route(s)")
 public class MinioComponentIntegrationTest extends CamelTestSupport {

Review comment:
       Junit5 is used, would be better to remove `public` access modifier in all test classes and all tests methods. So they will have default access modifier:
   ```
   class MinioComponentIntegrationTest extends CamelTestSupport {
   ```

##########
File path: components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioComponentIntegrationTest.java
##########
@@ -33,18 +36,22 @@
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
+@Disabled("Goto https://play.min.io and search for 'mycamelbucket'. If bucket(s) does not exist, set 'autoCreateBucket=true' in route(s)")
 public class MinioComponentIntegrationTest extends CamelTestSupport {
+    final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
 
     @EndpointInject("direct:start")
     private ProducerTemplate template;
 
     @EndpointInject("mock:result")
     private MockEndpoint result;
 
+    public MinioComponentIntegrationTest() throws IOException {
+    }
+
     @Test
     public void sendInOnly() throws Exception {

Review comment:
       Junit5 is used, would be better to remove `public` access modifier in all test classes and all tests methods. So they will have default access modifier:
   ```
   void sendInOnly() throws Exception {
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] Nayananga commented on pull request #4101: Added testcontainer integration test for Minio

Posted by GitBox <gi...@apache.org>.
Nayananga commented on pull request #4101:
URL: https://github.com/apache/camel/pull/4101#issuecomment-678806087


   @omarsmak, @DenisIstomin I guess all the tests work fine now,


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] omarsmak commented on a change in pull request #4101: Added testcontainer integration test for Minio

Posted by GitBox <gi...@apache.org>.
omarsmak commented on a change in pull request #4101:
URL: https://github.com/apache/camel/pull/4101#discussion_r473074534



##########
File path: components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/testContainers/MinioComponentIntegrationTest.java
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.minio.integration.testContainers;
+
+import java.io.IOException;
+import java.time.Duration;
+import java.util.Properties;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.Message;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.minio.MinioConstants;
+import org.apache.camel.component.minio.integration.MinioTestUtils;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.testcontainers.junit5.ContainerAwareTestSupport;
+import org.junit.jupiter.api.Test;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.wait.strategy.HttpWaitStrategy;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+public class MinioComponentIntegrationTest extends ContainerAwareTestSupport {
+
+    final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
+    final int port = 9000;
+
+    @EndpointInject("direct:start")
+    private ProducerTemplate template;
+
+    @EndpointInject("mock:result")
+    private MockEndpoint result;
+
+    public MinioComponentIntegrationTest() throws IOException {
+    }
+
+    @Test
+    public void sendInOnly() throws Exception {
+        result.expectedMessageCount(1);
+
+        Exchange exchange1 = template.send("direct:start", ExchangePattern.InOnly, exchange -> {
+            exchange.getIn().setHeader(MinioConstants.OBJECT_NAME, "CamelUnitTest");
+            exchange.getIn().setBody("This is my bucket content.");
+        });
+
+        Exchange exchange2 = template.send("direct:start", ExchangePattern.InOnly, exchange -> {
+            exchange.getIn().setHeader(MinioConstants.OBJECT_NAME, "CamelUnitTest");
+            exchange.getIn().setBody("This is my bucket content.");
+        });
+
+        assertMockEndpointsSatisfied();
+
+        assertResultExchange(result.getExchanges().get(0));
+
+        assertResponseMessage(exchange1.getIn());
+        assertResponseMessage(exchange2.getIn());
+    }
+
+    @Test
+    public void sendInOut() throws Exception {
+        result.expectedMessageCount(1);
+
+        Exchange exchange = template.send("direct:start", ExchangePattern.InOut, exchange1 -> {
+            exchange1.getIn().setHeader(MinioConstants.OBJECT_NAME, "CamelUnitTest");
+            exchange1.getIn().setBody("This is my bucket content.");
+        });
+
+        assertMockEndpointsSatisfied();
+
+        assertResultExchange(result.getExchanges().get(0));
+
+        assertResponseMessage(exchange.getMessage());
+    }
+
+    private void assertResultExchange(Exchange resultExchange) {
+        assertEquals("This is my bucket content.", resultExchange.getIn().getBody(String.class));
+        assertEquals("mycamelbucket", resultExchange.getIn().getHeader(MinioConstants.BUCKET_NAME));
+        assertTrue(resultExchange.getIn().getHeader(MinioConstants.OBJECT_NAME, String.class).startsWith("CamelUnitTest"));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.VERSION_ID)); // not enabled on this bucket
+        assertNotNull(resultExchange.getIn().getHeader(MinioConstants.LAST_MODIFIED));
+        assertEquals("application/octet-stream", resultExchange.getIn().getHeader(MinioConstants.CONTENT_TYPE));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.CONTENT_ENCODING));
+        assertEquals(26L, resultExchange.getIn().getHeader(MinioConstants.CONTENT_LENGTH));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.CONTENT_DISPOSITION));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.CONTENT_MD5));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.CACHE_CONTROL));
+    }
+
+    private void assertResponseMessage(Message message) {
+        assertNull(message.getHeader(MinioConstants.VERSION_ID));
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            @Override
+            public void configure() {
+                String minioEndpointUri =
+                        "minio://mycamelbucket?accessKey=Q3AM3UQ867SPQQA43P2F&secretKey=RAW(zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG)&region=us-west-1&autoCreateBucket=true&endpoint=http://127.0.0.1&proxyPort=9000";

Review comment:
       @Nayananga Try to use something similar to [this](https://github.com/apache/camel/blob/992a6b9685f4db49236e540af2546548cf99a7d3/components/camel-couchdb/src/test/java/org/apache/camel/component/couchdb/CouchDbTestSupport.java) as I think testcontainer will generate dynamic IP but then needs to be mapped




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] oscerd merged pull request #4101: Added testcontainer integration test for Minio

Posted by GitBox <gi...@apache.org>.
oscerd merged pull request #4101:
URL: https://github.com/apache/camel/pull/4101


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] omarsmak commented on a change in pull request #4101: Added testcontainer integration test for Minio

Posted by GitBox <gi...@apache.org>.
omarsmak commented on a change in pull request #4101:
URL: https://github.com/apache/camel/pull/4101#discussion_r472921664



##########
File path: components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/testContainers/MinioComponentIntegrationTest.java
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.minio.integration.testContainers;
+
+import java.io.IOException;
+import java.time.Duration;
+import java.util.Properties;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.Message;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.minio.MinioConstants;
+import org.apache.camel.component.minio.integration.MinioTestUtils;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.testcontainers.junit5.ContainerAwareTestSupport;
+import org.junit.jupiter.api.Test;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.wait.strategy.HttpWaitStrategy;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+public class MinioComponentIntegrationTest extends ContainerAwareTestSupport {
+
+    final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
+    final int port = 9000;
+
+    @EndpointInject("direct:start")
+    private ProducerTemplate template;
+
+    @EndpointInject("mock:result")
+    private MockEndpoint result;
+
+    public MinioComponentIntegrationTest() throws IOException {
+    }
+
+    @Test
+    public void sendInOnly() throws Exception {
+        result.expectedMessageCount(1);
+
+        Exchange exchange1 = template.send("direct:start", ExchangePattern.InOnly, exchange -> {
+            exchange.getIn().setHeader(MinioConstants.OBJECT_NAME, "CamelUnitTest");
+            exchange.getIn().setBody("This is my bucket content.");
+        });
+
+        Exchange exchange2 = template.send("direct:start", ExchangePattern.InOnly, exchange -> {
+            exchange.getIn().setHeader(MinioConstants.OBJECT_NAME, "CamelUnitTest");
+            exchange.getIn().setBody("This is my bucket content.");
+        });
+
+        assertMockEndpointsSatisfied();
+
+        assertResultExchange(result.getExchanges().get(0));
+
+        assertResponseMessage(exchange1.getIn());
+        assertResponseMessage(exchange2.getIn());
+    }
+
+    @Test
+    public void sendInOut() throws Exception {
+        result.expectedMessageCount(1);
+
+        Exchange exchange = template.send("direct:start", ExchangePattern.InOut, exchange1 -> {
+            exchange1.getIn().setHeader(MinioConstants.OBJECT_NAME, "CamelUnitTest");
+            exchange1.getIn().setBody("This is my bucket content.");
+        });
+
+        assertMockEndpointsSatisfied();
+
+        assertResultExchange(result.getExchanges().get(0));
+
+        assertResponseMessage(exchange.getMessage());
+    }
+
+    private void assertResultExchange(Exchange resultExchange) {
+        assertEquals("This is my bucket content.", resultExchange.getIn().getBody(String.class));
+        assertEquals("mycamelbucket", resultExchange.getIn().getHeader(MinioConstants.BUCKET_NAME));
+        assertTrue(resultExchange.getIn().getHeader(MinioConstants.OBJECT_NAME, String.class).startsWith("CamelUnitTest"));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.VERSION_ID)); // not enabled on this bucket
+        assertNotNull(resultExchange.getIn().getHeader(MinioConstants.LAST_MODIFIED));
+        assertEquals("application/octet-stream", resultExchange.getIn().getHeader(MinioConstants.CONTENT_TYPE));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.CONTENT_ENCODING));
+        assertEquals(26L, resultExchange.getIn().getHeader(MinioConstants.CONTENT_LENGTH));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.CONTENT_DISPOSITION));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.CONTENT_MD5));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.CACHE_CONTROL));
+    }
+
+    private void assertResponseMessage(Message message) {
+        assertNull(message.getHeader(MinioConstants.VERSION_ID));
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            @Override
+            public void configure() {
+                String minioEndpointUri =
+                        "minio://mycamelbucket?accessKey=Q3AM3UQ867SPQQA43P2F&secretKey=RAW(zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG)&region=us-west-1&autoCreateBucket=true&endpoint=http://127.0.0.1&proxyPort=9000";

Review comment:
       Please don't add credentials to the source code files




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] omarsmak commented on a change in pull request #4101: Added testcontainer integration test for Minio

Posted by GitBox <gi...@apache.org>.
omarsmak commented on a change in pull request #4101:
URL: https://github.com/apache/camel/pull/4101#discussion_r473074534



##########
File path: components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/testContainers/MinioComponentIntegrationTest.java
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.minio.integration.testContainers;
+
+import java.io.IOException;
+import java.time.Duration;
+import java.util.Properties;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.Message;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.minio.MinioConstants;
+import org.apache.camel.component.minio.integration.MinioTestUtils;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.testcontainers.junit5.ContainerAwareTestSupport;
+import org.junit.jupiter.api.Test;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.wait.strategy.HttpWaitStrategy;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+public class MinioComponentIntegrationTest extends ContainerAwareTestSupport {
+
+    final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
+    final int port = 9000;
+
+    @EndpointInject("direct:start")
+    private ProducerTemplate template;
+
+    @EndpointInject("mock:result")
+    private MockEndpoint result;
+
+    public MinioComponentIntegrationTest() throws IOException {
+    }
+
+    @Test
+    public void sendInOnly() throws Exception {
+        result.expectedMessageCount(1);
+
+        Exchange exchange1 = template.send("direct:start", ExchangePattern.InOnly, exchange -> {
+            exchange.getIn().setHeader(MinioConstants.OBJECT_NAME, "CamelUnitTest");
+            exchange.getIn().setBody("This is my bucket content.");
+        });
+
+        Exchange exchange2 = template.send("direct:start", ExchangePattern.InOnly, exchange -> {
+            exchange.getIn().setHeader(MinioConstants.OBJECT_NAME, "CamelUnitTest");
+            exchange.getIn().setBody("This is my bucket content.");
+        });
+
+        assertMockEndpointsSatisfied();
+
+        assertResultExchange(result.getExchanges().get(0));
+
+        assertResponseMessage(exchange1.getIn());
+        assertResponseMessage(exchange2.getIn());
+    }
+
+    @Test
+    public void sendInOut() throws Exception {
+        result.expectedMessageCount(1);
+
+        Exchange exchange = template.send("direct:start", ExchangePattern.InOut, exchange1 -> {
+            exchange1.getIn().setHeader(MinioConstants.OBJECT_NAME, "CamelUnitTest");
+            exchange1.getIn().setBody("This is my bucket content.");
+        });
+
+        assertMockEndpointsSatisfied();
+
+        assertResultExchange(result.getExchanges().get(0));
+
+        assertResponseMessage(exchange.getMessage());
+    }
+
+    private void assertResultExchange(Exchange resultExchange) {
+        assertEquals("This is my bucket content.", resultExchange.getIn().getBody(String.class));
+        assertEquals("mycamelbucket", resultExchange.getIn().getHeader(MinioConstants.BUCKET_NAME));
+        assertTrue(resultExchange.getIn().getHeader(MinioConstants.OBJECT_NAME, String.class).startsWith("CamelUnitTest"));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.VERSION_ID)); // not enabled on this bucket
+        assertNotNull(resultExchange.getIn().getHeader(MinioConstants.LAST_MODIFIED));
+        assertEquals("application/octet-stream", resultExchange.getIn().getHeader(MinioConstants.CONTENT_TYPE));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.CONTENT_ENCODING));
+        assertEquals(26L, resultExchange.getIn().getHeader(MinioConstants.CONTENT_LENGTH));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.CONTENT_DISPOSITION));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.CONTENT_MD5));
+        assertNull(resultExchange.getIn().getHeader(MinioConstants.CACHE_CONTROL));
+    }
+
+    private void assertResponseMessage(Message message) {
+        assertNull(message.getHeader(MinioConstants.VERSION_ID));
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            @Override
+            public void configure() {
+                String minioEndpointUri =
+                        "minio://mycamelbucket?accessKey=Q3AM3UQ867SPQQA43P2F&secretKey=RAW(zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG)&region=us-west-1&autoCreateBucket=true&endpoint=http://127.0.0.1&proxyPort=9000";

Review comment:
       @Nayananga Try to use something similar to [this](https://github.com/apache/camel/blob/992a6b9685f4db49236e540af2546548cf99a7d3/components/camel-couchdb/src/test/java/org/apache/camel/component/couchdb/CouchDbTestSupport.java) as I think testcontainer will generate dynamic IP but then needs to be mapped and then something like `getContainer(CONTAINER_NAME).getContainerIpAddress();` to access your container's IP




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] omarsmak commented on pull request #4101: Added testcontainer integration test for Minio

Posted by GitBox <gi...@apache.org>.
omarsmak commented on pull request #4101:
URL: https://github.com/apache/camel/pull/4101#issuecomment-678253878


   @Nayananga did it work after your last modification?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] oscerd commented on pull request #4101: Added testcontainer integration test for Minio

Posted by GitBox <gi...@apache.org>.
oscerd commented on pull request #4101:
URL: https://github.com/apache/camel/pull/4101#issuecomment-680996110


   I think we can merge this and rework the integration test.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] Nayananga commented on pull request #4101: Added testcontainer integration test for Minio

Posted by GitBox <gi...@apache.org>.
Nayananga commented on pull request #4101:
URL: https://github.com/apache/camel/pull/4101#issuecomment-679045304


   @omarsmak, yes, I was mimicking [these](https://github.com/apache/camel/blob/df0dfddeb205bf29a8148cb2862308f7a5b8a853/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectCustomerKeyOperationIntegrationTest.java#L75) remote tests. these tests will fail time to time because [play.minio.io](http://play.minio.io) environment clears pre-created buckets after a while,
   > Caused by: org.apache.camel.RuntimeCamelException: Bucket {} does not exists, set autoCreateBucket option for bucket auto creation: io.minio.errors.InvalidBucketNameException: mycamel1
   
   as you can see mycamel1 bucket should exist in the environment before testing, that is why those tests were disabled before and now they have a separate maven profile so they can be manually tested.
   
   one workaround is ```autoCreateBucket=true```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org