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 2021/11/16 14:13:58 UTC
[camel] 02/05: CAMEL-17161 - Added an integration test, but it will need real credentials
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 96a0b14187baca640a707d7fc222a61abce37d62
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Nov 16 15:03:02 2021 +0100
CAMEL-17161 - Added an integration test, but it will need real credentials
---
.../blob/integration/BlobCopyProducerIt.java | 55 ++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/components/camel-azure/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/integration/BlobCopyProducerIt.java b/components/camel-azure/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/integration/BlobCopyProducerIt.java
new file mode 100644
index 0000000..419cc6d
--- /dev/null
+++ b/components/camel-azure/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/integration/BlobCopyProducerIt.java
@@ -0,0 +1,55 @@
+/*
+ * 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.azure.storage.blob.integration;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.azure.storage.blob.BlobConstants;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.junit.Ignore;
+import org.junit.jupiter.api.Test;
+
+@Ignore("Requires real credentials")
+class BlobCopyProducerIt extends CamelTestSupport {
+
+ @EndpointInject
+ private ProducerTemplate template;
+
+ @Test
+ void testUploadBlockBlob() throws InterruptedException {
+
+ template.send("direct:uploadBlockBlob", exchange -> {
+ exchange.getIn().setHeader(BlobConstants.BLOB_NAME, "pmi.txt");
+ exchange.getMessage().setHeader(BlobConstants.SOURCE_BLOB_CONTAINER_NAME, "test214");
+ exchange.getMessage().setHeader(BlobConstants.SOURCE_BLOB_ACCOUNT_NAME, "testblob214");
+ });
+
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:copyBlob")
+ .to("azure-storage-blob://testblob214/test215?operation=copyBlob&sourceBlobAccessKey=RAW(sourceAccessKey)&accessKey=(accessKey)");
+ }
+ };
+ }
+}