You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/08/27 06:03:40 UTC
[camel] branch master updated: Added testcontainer integration test
for Minio (#4101)
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new c40364a Added testcontainer integration test for Minio (#4101)
c40364a is described below
commit c40364a59815239e63d959faa982cb5212a217a3
Author: Nayananga Anuradha Muhandiram <na...@gmail.com>
AuthorDate: Thu Aug 27 11:33:20 2020 +0530
Added testcontainer integration test for Minio (#4101)
* Added testcontainer integration test
* Checkstyle errors fixed
* Checkstyle errors fixed
* Fixed errors in tests
* Fixed errors in tests
* Fixed errors in tests
* Added maven test profiles
* Changed test's access modifiers from public to default
---
components/camel-minio/pom.xml | 65 +++++++++++++++++++++-
.../component/minio/MinioClientFactoryTest.java | 4 +-
.../minio/MinioComponentConfigurationTest.java | 7 +--
.../minio/MinioComponentVerifierExtensionTest.java | 8 +--
.../minio/{integration => }/MinioTestUtils.java | 4 +-
.../MinioComponentIntegrationTest.java | 26 ++++-----
.../MinioConsumerIntegrationTest.java | 24 +++-----
.../MinioCopyObjectOperationIntegrationTest.java | 24 ++++----
.../MinioDeleteBucketOperationIntegrationTest.java | 22 ++------
.../MinioListObjectsOperationIntegrationTest.java | 19 +++----
.../MinioObjectRangeOperationIntegrationTest.java | 35 +++++++-----
.../localTests/MinioTestContainerSupport.java | 59 ++++++++++++++++++++
.../MinioComponentIntegrationTest.java | 26 ++++++---
.../MinioConsumerIntegrationTest.java | 11 ++--
...yObjectCustomerKeyOperationIntegrationTest.java | 12 ++--
.../MinioCopyObjectOperationIntegrationTest.java | 11 ++--
.../MinioDeleteBucketOperationIntegrationTest.java | 11 ++--
.../MinioListObjectsOperationIntegrationTest.java | 11 ++--
.../MinioObjectRangeOperationIntegrationTest.java | 12 ++--
19 files changed, 247 insertions(+), 144 deletions(-)
diff --git a/components/camel-minio/pom.xml b/components/camel-minio/pom.xml
index 9328d7d..72a3c7f 100644
--- a/components/camel-minio/pom.xml
+++ b/components/camel-minio/pom.xml
@@ -74,6 +74,69 @@
<artifactId>camel-test-spring-junit5</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-testcontainers-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
-
+ <profiles>
+ <profile>
+ <id>fullTests</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${maven-surefire-plugin-version}</version>
+ <executions>
+ <execution>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <excludes>
+ <exclude>none</exclude>
+ </excludes>
+ <includes>
+ <include>**/*Test</include>
+ </includes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>localTests</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${maven-surefire-plugin-version}</version>
+ <executions>
+ <execution>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <excludes>
+ <exclude>*/remoteTests/*</exclude>
+ </excludes>
+ <includes>
+ <include>**/*Test</include>
+ </includes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/MinioClientFactoryTest.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/MinioClientFactoryTest.java
index bf5ab50..9f8db4a 100644
--- a/components/camel-minio/src/test/java/org/apache/camel/component/minio/MinioClientFactoryTest.java
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/MinioClientFactoryTest.java
@@ -23,10 +23,10 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
-public class MinioClientFactoryTest {
+class MinioClientFactoryTest {
@Test
- public void getStandardMinioClientDefault() {
+ void getStandardMinioClientDefault() {
MinioConfiguration minioConfiguration = new MinioConfiguration();
MinioCamelInternalClient minioClient = MinioClientFactory.getClient(minioConfiguration);
assertTrue(minioClient instanceof MinioRemoteClientImpl);
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/MinioComponentConfigurationTest.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/MinioComponentConfigurationTest.java
index 1fe9559..d67f782 100644
--- a/components/camel-minio/src/test/java/org/apache/camel/component/minio/MinioComponentConfigurationTest.java
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/MinioComponentConfigurationTest.java
@@ -19,17 +19,16 @@ package org.apache.camel.component.minio;
import java.util.Properties;
import io.minio.MinioClient;
-import org.apache.camel.component.minio.integration.MinioTestUtils;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertSame;
-public class MinioComponentConfigurationTest extends CamelTestSupport {
+class MinioComponentConfigurationTest extends CamelTestSupport {
@Test
- public void createEndpointWithMinimalConfiguration() throws Exception {
+ void createEndpointWithMinimalConfiguration() throws Exception {
MinioComponent component = context.getComponent("minio", MinioComponent.class);
MinioEndpoint endpoint = (MinioEndpoint) component
.createEndpoint(
@@ -42,7 +41,7 @@ public class MinioComponentConfigurationTest extends CamelTestSupport {
}
@Test
- public void createEndpointWithCredentialsAndClientExistInRegistry() throws Exception {
+ void createEndpointWithCredentialsAndClientExistInRegistry() throws Exception {
final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
MinioClient client = MinioClient.builder()
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/MinioComponentVerifierExtensionTest.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/MinioComponentVerifierExtensionTest.java
index 2c18e93..66bf585 100644
--- a/components/camel-minio/src/test/java/org/apache/camel/component/minio/MinioComponentVerifierExtensionTest.java
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/MinioComponentVerifierExtensionTest.java
@@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
-public class MinioComponentVerifierExtensionTest extends CamelTestSupport {
+class MinioComponentVerifierExtensionTest extends CamelTestSupport {
// *************************************************
// Tests (parameters)
@@ -37,7 +37,7 @@ public class MinioComponentVerifierExtensionTest extends CamelTestSupport {
}
@Test
- public void testParameters() {
+ void testParameters() {
Component component = context().getComponent("minio");
ComponentVerifierExtension verifier
@@ -55,7 +55,7 @@ public class MinioComponentVerifierExtensionTest extends CamelTestSupport {
}
@Test
- public void testConnectivity() {
+ void testConnectivity() {
Component component = context().getComponent("minio");
ComponentVerifierExtension verifier
= component.getExtension(ComponentVerifierExtension.class).orElseThrow(IllegalStateException::new);
@@ -72,7 +72,7 @@ public class MinioComponentVerifierExtensionTest extends CamelTestSupport {
}
@Test
- public void testConnectivityAndRegion() {
+ void testConnectivityAndRegion() {
Component component = context().getComponent("minio");
ComponentVerifierExtension verifier
= component.getExtension(ComponentVerifierExtension.class).orElseThrow(IllegalStateException::new);
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioTestUtils.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/MinioTestUtils.java
similarity index 94%
rename from components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioTestUtils.java
rename to components/camel-minio/src/test/java/org/apache/camel/component/minio/MinioTestUtils.java
index 8266804..c2cae2e 100644
--- a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioTestUtils.java
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/MinioTestUtils.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.minio.integration;
+package org.apache.camel.component.minio;
import java.io.IOException;
import java.io.InputStream;
@@ -38,7 +38,7 @@ public final class MinioTestUtils {
return properties;
}
- public static Properties loadMinioAccessFromJvmEnv() throws Exception {
+ static Properties loadMinioAccessFromJvmEnv() throws Exception {
final Properties properties = new Properties();
if (System.getProperty("endpoint") == null || System.getProperty("accessKey") == null
|| System.getProperty("secretKey") == null) {
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioComponentIntegrationTest.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioComponentIntegrationTest.java
similarity index 86%
copy from components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioComponentIntegrationTest.java
copy to components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioComponentIntegrationTest.java
index 86ddc68..88da95c 100644
--- a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioComponentIntegrationTest.java
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioComponentIntegrationTest.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.minio.integration;
+package org.apache.camel.component.minio.integration.localTests;
import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
@@ -24,8 +24,6 @@ import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.minio.MinioConstants;
import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -33,8 +31,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
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!")
-public class MinioComponentIntegrationTest extends CamelTestSupport {
+class MinioComponentIntegrationTest extends MinioTestContainerSupport {
@EndpointInject("direct:start")
private ProducerTemplate template;
@@ -43,33 +40,34 @@ public class MinioComponentIntegrationTest extends CamelTestSupport {
private MockEndpoint result;
@Test
- public void sendInOnly() throws Exception {
- result.expectedMessageCount(1);
+ void sendInOnly() throws Exception {
+ result.expectedMessageCount(2);
Exchange exchange1 = template.send("direct:start", ExchangePattern.InOnly, exchange -> {
- exchange.getIn().setHeader(MinioConstants.OBJECT_NAME, "CamelUnitTest");
+ exchange.getIn().setHeader(MinioConstants.OBJECT_NAME, "CamelUnitTest1");
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().setHeader(MinioConstants.OBJECT_NAME, "CamelUnitTest2");
exchange.getIn().setBody("This is my bucket content.");
});
assertMockEndpointsSatisfied();
assertResultExchange(result.getExchanges().get(0));
+ assertResultExchange(result.getExchanges().get(1));
assertResponseMessage(exchange1.getIn());
assertResponseMessage(exchange2.getIn());
}
@Test
- public void sendInOut() throws Exception {
+ 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().setHeader(MinioConstants.OBJECT_NAME, "CamelUnitTest3");
exchange1.getIn().setBody("This is my bucket content.");
});
@@ -104,8 +102,10 @@ public class MinioComponentIntegrationTest extends CamelTestSupport {
@Override
public void configure() {
String minioEndpointUri
- = "minio://mycamelbucket?accessKey=Q3AM3UQ867SPQQA43P2F&secretKey=RAW(zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG)®ion=us-west-1&autoCreateBucket=false&endpoint=https://play.min.io";
-
+ = "minio://mycamelbucket?accessKey=" + ACCESS_KEY
+ + "&secretKey=RAW(" + SECRET_KEY
+ + ")&autoCreateBucket=true&endpoint=http://" + CONTAINER.getHost() + "&proxyPort="
+ + CONTAINER.getMappedPort(BROKER_PORT);
from("direct:start").to(minioEndpointUri);
from(minioEndpointUri).to("mock:result");
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioConsumerIntegrationTest.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioConsumerIntegrationTest.java
similarity index 75%
copy from components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioConsumerIntegrationTest.java
copy to components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioConsumerIntegrationTest.java
index 366e26d..d0b74fd 100644
--- a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioConsumerIntegrationTest.java
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioConsumerIntegrationTest.java
@@ -14,9 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.minio.integration;
-
-import java.util.Properties;
+package org.apache.camel.component.minio.integration.localTests;
import io.minio.MinioClient;
import org.apache.camel.BindToRegistry;
@@ -25,19 +23,14 @@ import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.minio.MinioConstants;
import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
-@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
-public class MinioConsumerIntegrationTest extends CamelTestSupport {
- final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
+class MinioConsumerIntegrationTest extends MinioTestContainerSupport {
@BindToRegistry("minioClient")
MinioClient client = MinioClient.builder()
- .endpoint(properties.getProperty("endpoint"))
- .credentials(properties.getProperty("accessKey"), properties.getProperty("secretKey"))
- .region(properties.getProperty("region"))
+ .endpoint("http://" + CONTAINER.getHost(), CONTAINER.getMappedPort(BROKER_PORT), false)
+ .credentials(ACCESS_KEY, SECRET_KEY)
.build();
@EndpointInject
@@ -46,11 +39,8 @@ public class MinioConsumerIntegrationTest extends CamelTestSupport {
@EndpointInject("mock:result")
private MockEndpoint result;
- public MinioConsumerIntegrationTest() throws Exception {
- }
-
@Test
- public void sendIn() throws Exception {
+ void sendIn() throws Exception {
result.expectedMessageCount(3);
template.send("direct:putObject", exchange -> {
@@ -76,10 +66,10 @@ public class MinioConsumerIntegrationTest extends CamelTestSupport {
return new RouteBuilder() {
@Override
public void configure() {
- String minioEndpoint = "minio://mycamel?autoCreateBucket=false";
+ String minioEndpoint = "minio://mycamel?autoCreateBucket=true";
from("direct:putObject").startupOrder(1).to(minioEndpoint);
- from("minio://mycamel?moveAfterRead=true&destinationBucketName=camel-kafka-connector&autoCreateBucket=false")
+ from("minio://mycamel?moveAfterRead=true&destinationBucketName=camel-kafka-connector&autoCreateBucket=true")
.startupOrder(2).to("mock:result");
}
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioCopyObjectOperationIntegrationTest.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioCopyObjectOperationIntegrationTest.java
similarity index 75%
copy from components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioCopyObjectOperationIntegrationTest.java
copy to components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioCopyObjectOperationIntegrationTest.java
index 1772482..ee4dc67 100644
--- a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioCopyObjectOperationIntegrationTest.java
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioCopyObjectOperationIntegrationTest.java
@@ -14,10 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.minio.integration;
+package org.apache.camel.component.minio.integration.localTests;
import java.io.IOException;
-import java.util.Properties;
import io.minio.MinioClient;
import org.apache.camel.BindToRegistry;
@@ -27,18 +26,14 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.minio.MinioConstants;
import org.apache.camel.component.minio.MinioOperations;
import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
-@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
-public class MinioCopyObjectOperationIntegrationTest extends CamelTestSupport {
- final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
+class MinioCopyObjectOperationIntegrationTest extends MinioTestContainerSupport {
@BindToRegistry("minioClient")
- MinioClient minioClient = MinioClient.builder()
- .endpoint(properties.getProperty("endpoint"))
- .credentials(properties.getProperty("accessKey"), properties.getProperty("secretKey"))
+ MinioClient client = MinioClient.builder()
+ .endpoint("http://" + CONTAINER.getHost(), CONTAINER.getMappedPort(BROKER_PORT), false)
+ .credentials(ACCESS_KEY, SECRET_KEY)
.build();
@EndpointInject
@@ -47,11 +42,11 @@ public class MinioCopyObjectOperationIntegrationTest extends CamelTestSupport {
@EndpointInject("mock:result")
private MockEndpoint result;
- public MinioCopyObjectOperationIntegrationTest() throws IOException {
+ MinioCopyObjectOperationIntegrationTest() throws IOException {
}
@Test
- public void sendIn() throws Exception {
+ void sendIn() throws Exception {
result.expectedMessageCount(1);
template.send("direct:putObject", exchange -> {
@@ -74,9 +69,10 @@ public class MinioCopyObjectOperationIntegrationTest extends CamelTestSupport {
return new RouteBuilder() {
@Override
public void configure() {
- String minioEndpoint = "minio://mycamel?autoCreateBucket=false";
+ String minioEndpoint = "minio://mycamel?autoCreateBucket=true";
+ String minioEndpoint1 = "minio://mycamel1?autoCreateBucket=true";
- from("direct:putObject").to(minioEndpoint);
+ from("direct:putObject").to(minioEndpoint).to(minioEndpoint1);
from("direct:copyObject").to(minioEndpoint).to("mock:result");
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioDeleteBucketOperationIntegrationTest.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioDeleteBucketOperationIntegrationTest.java
similarity index 74%
copy from components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioDeleteBucketOperationIntegrationTest.java
copy to components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioDeleteBucketOperationIntegrationTest.java
index bb269c8..fc2969b 100644
--- a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioDeleteBucketOperationIntegrationTest.java
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioDeleteBucketOperationIntegrationTest.java
@@ -14,10 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.minio.integration;
-
-import java.io.IOException;
-import java.util.Properties;
+package org.apache.camel.component.minio.integration.localTests;
import io.minio.MinioClient;
import org.apache.camel.BindToRegistry;
@@ -27,18 +24,14 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.minio.MinioConstants;
import org.apache.camel.component.minio.MinioOperations;
import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
-@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
-public class MinioDeleteBucketOperationIntegrationTest extends CamelTestSupport {
- final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
+class MinioDeleteBucketOperationIntegrationTest extends MinioTestContainerSupport {
@BindToRegistry("minioClient")
- MinioClient minioClient = MinioClient.builder()
- .endpoint(properties.getProperty("endpoint"))
- .credentials(properties.getProperty("accessKey"), properties.getProperty("secretKey"))
+ MinioClient client = MinioClient.builder()
+ .endpoint("http://" + CONTAINER.getHost(), CONTAINER.getMappedPort(BROKER_PORT), false)
+ .credentials(ACCESS_KEY, SECRET_KEY)
.build();
@EndpointInject
@@ -47,11 +40,8 @@ public class MinioDeleteBucketOperationIntegrationTest extends CamelTestSupport
@EndpointInject("mock:result")
private MockEndpoint result;
- public MinioDeleteBucketOperationIntegrationTest() throws IOException {
- }
-
@Test
- public void sendIn() throws Exception {
+ void sendIn() throws Exception {
result.expectedMessageCount(1);
template.send("direct:listBuckets",
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioListObjectsOperationIntegrationTest.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioListObjectsOperationIntegrationTest.java
similarity index 84%
copy from components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioListObjectsOperationIntegrationTest.java
copy to components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioListObjectsOperationIntegrationTest.java
index a63be7c..d63ae1e 100644
--- a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioListObjectsOperationIntegrationTest.java
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioListObjectsOperationIntegrationTest.java
@@ -14,11 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.minio.integration;
+package org.apache.camel.component.minio.integration.localTests;
import java.io.IOException;
import java.util.Iterator;
-import java.util.Properties;
import com.google.common.collect.Iterators;
import io.minio.MinioClient;
@@ -33,20 +32,16 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.minio.MinioConstants;
import org.apache.camel.component.minio.MinioOperations;
import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
-@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
-public class MinioListObjectsOperationIntegrationTest extends CamelTestSupport {
- final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
+class MinioListObjectsOperationIntegrationTest extends MinioTestContainerSupport {
@BindToRegistry("minioClient")
- MinioClient minioClient = MinioClient.builder()
- .endpoint(properties.getProperty("endpoint"))
- .credentials(properties.getProperty("accessKey"), properties.getProperty("secretKey"))
+ MinioClient client = MinioClient.builder()
+ .endpoint("http://" + CONTAINER.getHost(), CONTAINER.getMappedPort(BROKER_PORT), false)
+ .credentials(ACCESS_KEY, SECRET_KEY)
.build();
@EndpointInject
@@ -55,12 +50,12 @@ public class MinioListObjectsOperationIntegrationTest extends CamelTestSupport {
@EndpointInject("mock:result")
private MockEndpoint result;
- public MinioListObjectsOperationIntegrationTest() throws IOException {
+ MinioListObjectsOperationIntegrationTest() throws IOException {
}
@SuppressWarnings("unchecked")
@Test
- public void sendIn() throws Exception {
+ void sendIn() throws Exception {
result.expectedMessageCount(1);
template.send("direct:listBuckets",
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioObjectRangeOperationIntegrationTest.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioObjectRangeOperationIntegrationTest.java
similarity index 71%
copy from components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioObjectRangeOperationIntegrationTest.java
copy to components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioObjectRangeOperationIntegrationTest.java
index 3fbb32a..14a2633 100644
--- a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioObjectRangeOperationIntegrationTest.java
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioObjectRangeOperationIntegrationTest.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.minio.integration;
+package org.apache.camel.component.minio.integration.localTests;
import java.io.BufferedReader;
import java.io.IOException;
@@ -23,7 +23,6 @@ import java.io.InputStreamReader;
import java.io.Reader;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
-import java.util.Properties;
import io.minio.MinioClient;
import org.apache.camel.BindToRegistry;
@@ -32,36 +31,41 @@ import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.minio.MinioConstants;
import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
-public class MinioObjectRangeOperationIntegrationTest extends CamelTestSupport {
+class MinioObjectRangeOperationIntegrationTest extends MinioTestContainerSupport {
private static final Logger LOG = LoggerFactory.getLogger(MinioObjectRangeOperationIntegrationTest.class);
- final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
@BindToRegistry("minioClient")
- MinioClient minioClient = MinioClient.builder()
- .endpoint(properties.getProperty("endpoint"))
- .credentials(properties.getProperty("accessKey"), properties.getProperty("secretKey"))
+ MinioClient client = MinioClient.builder()
+ .endpoint("http://" + CONTAINER.getHost(), CONTAINER.getMappedPort(BROKER_PORT), false)
+ .credentials(ACCESS_KEY, SECRET_KEY)
.build();
+
@EndpointInject
private ProducerTemplate template;
@EndpointInject("mock:result")
private MockEndpoint result;
- public MinioObjectRangeOperationIntegrationTest() throws IOException {
+ MinioObjectRangeOperationIntegrationTest() throws IOException {
}
@Test
- public void sendIn() throws Exception {
+ void sendIn() throws Exception {
result.expectedMessageCount(1);
+ template.send("direct:putObject", exchange -> {
+ exchange.getIn().setHeader(MinioConstants.OBJECT_NAME, "element.txt");
+ exchange.getIn()
+ .setBody("MinIO is a cloud storage server compatible with Amazon S3, released under Apache License v2. "
+ + "As an object store, MinIO can store unstructured data such as photos, videos, log files, backups and container images. "
+ + "The maximum size of an object is 5TB.");
+ });
+
template.send("direct:getPartialObject", exchange -> {
exchange.getIn().setHeader(MinioConstants.OBJECT_NAME, "element.txt");
exchange.getIn().setHeader(MinioConstants.OFFSET, 0);
@@ -76,9 +80,12 @@ public class MinioObjectRangeOperationIntegrationTest extends CamelTestSupport {
return new RouteBuilder() {
@Override
public void configure() {
- String minioEndpoint = "minio://mycamelbucket?operation=getPartialObject&autoCreateBucket=false";
+ String minioEndpoint = "minio://mycamelbucket?autoCreateBucket=true";
+ String minioEndpoint1 = "minio://mycamelbucket?operation=getPartialObject";
+
+ from("direct:putObject").to(minioEndpoint);
- from("direct:getPartialObject").to(minioEndpoint).process(exchange -> {
+ from("direct:getPartialObject").to(minioEndpoint1).process(exchange -> {
InputStream minioPartialObject = exchange.getIn().getBody(InputStream.class);
LOG.info(readInputStream(minioPartialObject));
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioTestContainerSupport.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioTestContainerSupport.java
new file mode 100644
index 0000000..32de07f
--- /dev/null
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/localTests/MinioTestContainerSupport.java
@@ -0,0 +1,59 @@
+/*
+ * 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.localTests;
+
+import java.io.IOException;
+import java.time.Duration;
+import java.util.Properties;
+
+import org.apache.camel.component.minio.MinioTestUtils;
+import org.apache.camel.test.testcontainers.junit5.ContainerAwareTestSupport;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.wait.strategy.HttpWaitStrategy;
+
+class MinioTestContainerSupport extends ContainerAwareTestSupport {
+ static Properties properties;
+
+ static {
+ try {
+ properties = MinioTestUtils.loadMinioPropertiesFile();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ static final String CONTAINER_IMAGE = "minio/minio:latest";
+ static final String CONTAINER_NAME = "minio";
+ static final String ACCESS_KEY = properties.getProperty("accessKey");
+ static final String SECRET_KEY = properties.getProperty("secretKey");
+ static final int BROKER_PORT = 9000;
+ static final GenericContainer CONTAINER;
+
+ static {
+ CONTAINER = new GenericContainer<>(CONTAINER_IMAGE).withNetworkAliases(CONTAINER_NAME)
+ .withEnv("MINIO_ACCESS_KEY", ACCESS_KEY)
+ .withEnv("MINIO_SECRET_KEY", SECRET_KEY)
+ .withCommand("server /data")
+ .withExposedPorts(BROKER_PORT)
+ .waitingFor(new HttpWaitStrategy()
+ .forPath("/minio/health/ready")
+ .forPort(BROKER_PORT)
+ .withStartupTimeout(Duration.ofSeconds(10)));
+
+ CONTAINER.start();
+ }
+}
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioComponentIntegrationTest.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioComponentIntegrationTest.java
similarity index 83%
rename from components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioComponentIntegrationTest.java
rename to components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioComponentIntegrationTest.java
index 86ddc68..5392901 100644
--- a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioComponentIntegrationTest.java
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioComponentIntegrationTest.java
@@ -14,7 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.minio.integration;
+package org.apache.camel.component.minio.integration.remoteTests;
+
+import java.io.IOException;
+import java.util.Properties;
import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
@@ -23,9 +26,9 @@ 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.MinioTestUtils;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -33,8 +36,8 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
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!")
-public class MinioComponentIntegrationTest extends CamelTestSupport {
+class MinioComponentIntegrationTest extends CamelTestSupport {
+ final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
@EndpointInject("direct:start")
private ProducerTemplate template;
@@ -42,9 +45,12 @@ public class MinioComponentIntegrationTest extends CamelTestSupport {
@EndpointInject("mock:result")
private MockEndpoint result;
+ MinioComponentIntegrationTest() throws IOException {
+ }
+
@Test
- public void sendInOnly() throws Exception {
- result.expectedMessageCount(1);
+ void sendInOnly() throws Exception {
+ result.expectedMessageCount(2);
Exchange exchange1 = template.send("direct:start", ExchangePattern.InOnly, exchange -> {
exchange.getIn().setHeader(MinioConstants.OBJECT_NAME, "CamelUnitTest");
@@ -59,13 +65,14 @@ public class MinioComponentIntegrationTest extends CamelTestSupport {
assertMockEndpointsSatisfied();
assertResultExchange(result.getExchanges().get(0));
+ assertResultExchange(result.getExchanges().get(1));
assertResponseMessage(exchange1.getIn());
assertResponseMessage(exchange2.getIn());
}
@Test
- public void sendInOut() throws Exception {
+ void sendInOut() throws Exception {
result.expectedMessageCount(1);
Exchange exchange = template.send("direct:start", ExchangePattern.InOut, exchange1 -> {
@@ -104,8 +111,9 @@ public class MinioComponentIntegrationTest extends CamelTestSupport {
@Override
public void configure() {
String minioEndpointUri
- = "minio://mycamelbucket?accessKey=Q3AM3UQ867SPQQA43P2F&secretKey=RAW(zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG)®ion=us-west-1&autoCreateBucket=false&endpoint=https://play.min.io";
-
+ = "minio://mycamelbucket?accessKey=" + properties.getProperty("accessKey")
+ + "&secretKey=RAW(" + properties.getProperty("secretKey")
+ + ")®ion=us-west-1&autoCreateBucket=false&endpoint=https://play.min.io&deleteAfterRead=false";
from("direct:start").to(minioEndpointUri);
from(minioEndpointUri).to("mock:result");
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioConsumerIntegrationTest.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioConsumerIntegrationTest.java
similarity index 89%
rename from components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioConsumerIntegrationTest.java
rename to components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioConsumerIntegrationTest.java
index 366e26d..f09ba43 100644
--- a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioConsumerIntegrationTest.java
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioConsumerIntegrationTest.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.minio.integration;
+package org.apache.camel.component.minio.integration.remoteTests;
import java.util.Properties;
@@ -24,13 +24,12 @@ import org.apache.camel.EndpointInject;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.minio.MinioConstants;
+import org.apache.camel.component.minio.MinioTestUtils;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
-@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
-public class MinioConsumerIntegrationTest extends CamelTestSupport {
+class MinioConsumerIntegrationTest extends CamelTestSupport {
final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
@BindToRegistry("minioClient")
@@ -46,11 +45,11 @@ public class MinioConsumerIntegrationTest extends CamelTestSupport {
@EndpointInject("mock:result")
private MockEndpoint result;
- public MinioConsumerIntegrationTest() throws Exception {
+ MinioConsumerIntegrationTest() throws Exception {
}
@Test
- public void sendIn() throws Exception {
+ void sendIn() throws Exception {
result.expectedMessageCount(3);
template.send("direct:putObject", exchange -> {
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioCopyObjectCustomerKeyOperationIntegrationTest.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioCopyObjectCustomerKeyOperationIntegrationTest.java
similarity index 93%
rename from components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioCopyObjectCustomerKeyOperationIntegrationTest.java
rename to components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioCopyObjectCustomerKeyOperationIntegrationTest.java
index 226927f..aa75e77 100644
--- a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioCopyObjectCustomerKeyOperationIntegrationTest.java
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioCopyObjectCustomerKeyOperationIntegrationTest.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.minio.integration;
+package org.apache.camel.component.minio.integration.remoteTests;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
@@ -44,16 +44,15 @@ import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.minio.MinioConstants;
import org.apache.camel.component.minio.MinioOperations;
+import org.apache.camel.component.minio.MinioTestUtils;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
-@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
-public class MinioCopyObjectCustomerKeyOperationIntegrationTest extends CamelTestSupport {
+class MinioCopyObjectCustomerKeyOperationIntegrationTest extends CamelTestSupport {
final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
final ServerSideEncryptionCustomerKey secretKey = generateSecretKey();
@@ -64,17 +63,18 @@ public class MinioCopyObjectCustomerKeyOperationIntegrationTest extends CamelTes
.endpoint(properties.getProperty("endpoint"))
.credentials(properties.getProperty("accessKey"), properties.getProperty("secretKey"))
.build();
+
@EndpointInject
private ProducerTemplate template;
@EndpointInject("mock:result")
private MockEndpoint result;
- public MinioCopyObjectCustomerKeyOperationIntegrationTest() throws IOException {
+ MinioCopyObjectCustomerKeyOperationIntegrationTest() throws IOException {
}
@Test
- public void sendIn() throws Exception {
+ void sendIn() throws Exception {
result.expectedMessageCount(1);
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioCopyObjectOperationIntegrationTest.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioCopyObjectOperationIntegrationTest.java
similarity index 88%
rename from components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioCopyObjectOperationIntegrationTest.java
rename to components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioCopyObjectOperationIntegrationTest.java
index 1772482..c061cb2 100644
--- a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioCopyObjectOperationIntegrationTest.java
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioCopyObjectOperationIntegrationTest.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.minio.integration;
+package org.apache.camel.component.minio.integration.remoteTests;
import java.io.IOException;
import java.util.Properties;
@@ -26,13 +26,12 @@ import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.minio.MinioConstants;
import org.apache.camel.component.minio.MinioOperations;
+import org.apache.camel.component.minio.MinioTestUtils;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
-@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
-public class MinioCopyObjectOperationIntegrationTest extends CamelTestSupport {
+class MinioCopyObjectOperationIntegrationTest extends CamelTestSupport {
final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
@BindToRegistry("minioClient")
@@ -47,11 +46,11 @@ public class MinioCopyObjectOperationIntegrationTest extends CamelTestSupport {
@EndpointInject("mock:result")
private MockEndpoint result;
- public MinioCopyObjectOperationIntegrationTest() throws IOException {
+ MinioCopyObjectOperationIntegrationTest() throws IOException {
}
@Test
- public void sendIn() throws Exception {
+ void sendIn() throws Exception {
result.expectedMessageCount(1);
template.send("direct:putObject", exchange -> {
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioDeleteBucketOperationIntegrationTest.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioDeleteBucketOperationIntegrationTest.java
similarity index 87%
rename from components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioDeleteBucketOperationIntegrationTest.java
rename to components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioDeleteBucketOperationIntegrationTest.java
index bb269c8..f175c3c 100644
--- a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioDeleteBucketOperationIntegrationTest.java
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioDeleteBucketOperationIntegrationTest.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.minio.integration;
+package org.apache.camel.component.minio.integration.remoteTests;
import java.io.IOException;
import java.util.Properties;
@@ -26,13 +26,12 @@ import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.minio.MinioConstants;
import org.apache.camel.component.minio.MinioOperations;
+import org.apache.camel.component.minio.MinioTestUtils;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
-@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
-public class MinioDeleteBucketOperationIntegrationTest extends CamelTestSupport {
+class MinioDeleteBucketOperationIntegrationTest extends CamelTestSupport {
final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
@BindToRegistry("minioClient")
@@ -47,11 +46,11 @@ public class MinioDeleteBucketOperationIntegrationTest extends CamelTestSupport
@EndpointInject("mock:result")
private MockEndpoint result;
- public MinioDeleteBucketOperationIntegrationTest() throws IOException {
+ MinioDeleteBucketOperationIntegrationTest() throws IOException {
}
@Test
- public void sendIn() throws Exception {
+ void sendIn() throws Exception {
result.expectedMessageCount(1);
template.send("direct:listBuckets",
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioListObjectsOperationIntegrationTest.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioListObjectsOperationIntegrationTest.java
similarity index 92%
rename from components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioListObjectsOperationIntegrationTest.java
rename to components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioListObjectsOperationIntegrationTest.java
index a63be7c..ae191ba 100644
--- a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioListObjectsOperationIntegrationTest.java
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioListObjectsOperationIntegrationTest.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.minio.integration;
+package org.apache.camel.component.minio.integration.remoteTests;
import java.io.IOException;
import java.util.Iterator;
@@ -32,15 +32,14 @@ import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.minio.MinioConstants;
import org.apache.camel.component.minio.MinioOperations;
+import org.apache.camel.component.minio.MinioTestUtils;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
-@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
-public class MinioListObjectsOperationIntegrationTest extends CamelTestSupport {
+class MinioListObjectsOperationIntegrationTest extends CamelTestSupport {
final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
@BindToRegistry("minioClient")
@@ -55,12 +54,12 @@ public class MinioListObjectsOperationIntegrationTest extends CamelTestSupport {
@EndpointInject("mock:result")
private MockEndpoint result;
- public MinioListObjectsOperationIntegrationTest() throws IOException {
+ MinioListObjectsOperationIntegrationTest() throws IOException {
}
@SuppressWarnings("unchecked")
@Test
- public void sendIn() throws Exception {
+ void sendIn() throws Exception {
result.expectedMessageCount(1);
template.send("direct:listBuckets",
diff --git a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioObjectRangeOperationIntegrationTest.java b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioObjectRangeOperationIntegrationTest.java
similarity index 90%
rename from components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioObjectRangeOperationIntegrationTest.java
rename to components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioObjectRangeOperationIntegrationTest.java
index 3fbb32a..3adb059 100644
--- a/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/MinioObjectRangeOperationIntegrationTest.java
+++ b/components/camel-minio/src/test/java/org/apache/camel/component/minio/integration/remoteTests/MinioObjectRangeOperationIntegrationTest.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.minio.integration;
+package org.apache.camel.component.minio.integration.remoteTests;
import java.io.BufferedReader;
import java.io.IOException;
@@ -31,15 +31,14 @@ import org.apache.camel.EndpointInject;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.minio.MinioConstants;
+import org.apache.camel.component.minio.MinioTestUtils;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
-public class MinioObjectRangeOperationIntegrationTest extends CamelTestSupport {
+class MinioObjectRangeOperationIntegrationTest extends CamelTestSupport {
private static final Logger LOG = LoggerFactory.getLogger(MinioObjectRangeOperationIntegrationTest.class);
final Properties properties = MinioTestUtils.loadMinioPropertiesFile();
@@ -49,17 +48,18 @@ public class MinioObjectRangeOperationIntegrationTest extends CamelTestSupport {
.endpoint(properties.getProperty("endpoint"))
.credentials(properties.getProperty("accessKey"), properties.getProperty("secretKey"))
.build();
+
@EndpointInject
private ProducerTemplate template;
@EndpointInject("mock:result")
private MockEndpoint result;
- public MinioObjectRangeOperationIntegrationTest() throws IOException {
+ MinioObjectRangeOperationIntegrationTest() throws IOException {
}
@Test
- public void sendIn() throws Exception {
+ void sendIn() throws Exception {
result.expectedMessageCount(1);
template.send("direct:getPartialObject", exchange -> {