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/03/20 14:00:10 UTC

[camel] 03/04: CAMEL-14658 - Provide a simpler way to connect to a local s3 instance, added test

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

commit 8187e58c1fdd1b3f025cbd3231a650b692bd783e
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Mar 20 14:45:22 2020 +0100

    CAMEL-14658 - Provide a simpler way to connect to a local s3 instance, added test
---
 .../aws2/s3/S3ComponentConfigurationTest.java      | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/S3ComponentConfigurationTest.java b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/S3ComponentConfigurationTest.java
new file mode 100644
index 0000000..a75a925
--- /dev/null
+++ b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/S3ComponentConfigurationTest.java
@@ -0,0 +1,34 @@
+/*
+ * 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.aws2.s3;
+
+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.assertTrue;
+
+public class S3ComponentConfigurationTest extends CamelTestSupport {
+
+    @Test
+    public void createEndpointWithMinimalConfiguration() throws Exception {
+        AWS2S3Component component = context.getComponent("aws2-s3", AWS2S3Component.class);
+        AWS2S3Endpoint endpoint = (AWS2S3Endpoint)component.createEndpoint("aws2-s3://TestDomain?accessKey=xxx&secretKey=yyy&region=us-west-1&overrideEndpoint=true&uriEndpointOverride=http://localhost:4572");
+        assertTrue(endpoint.getConfiguration().isOverrideEndpoint());
+        assertEquals(endpoint.getConfiguration().getUriEndpointOverride(), "http://localhost:4572");
+    }
+}