You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pp...@apache.org on 2021/01/19 10:14:06 UTC
[camel-quarkus] 02/02: Azure Storage Queue Service native support
#1574
This is an automated email from the ASF dual-hosted git repository.
ppalaga pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 3b78554bc5b538533fd58c49c4bb1620b4eb39fd
Author: Peter Palaga <pp...@redhat.com>
AuthorDate: Fri Jan 15 17:28:48 2021 +0100
Azure Storage Queue Service native support #1574
---
.../reference/extensions/azure-storage-queue.adoc | 14 ++--
.../reference/components/azure-storage-queue.adoc | 6 +-
.../deployment/AzureStorageQueueProcessor.java | 46 ------------
.../queue/it/AzureStorageQueueResource.java | 51 --------------
extensions-jvm/pom.xml | 1 -
.../azure-storage-queue/deployment/pom.xml | 4 ++
.../deployment/AzureStorageQueueProcessor.java | 82 ++++++++++++++++++++++
.../azure-storage-queue/pom.xml | 1 -
.../azure-storage-queue/runtime/pom.xml | 5 ++
.../main/resources/META-INF/quarkus-extension.yaml | 3 +-
extensions/pom.xml | 1 +
.../azure}/pom.xml | 47 ++++++-------
.../support/azure/AzureStorageTestResource.java | 60 ++++------------
integration-tests-support/pom.xml | 1 +
integration-tests/azure-storage-blob/pom.xml | 7 +-
.../storage/blob/it/AzureStorageBlobResource.java | 4 +-
.../src/main/resources/application.properties | 6 +-
.../azure/storage/blob/it/AzureStorageBlobIT.java | 3 +-
.../storage/blob/it/AzureStorageBlobTest.java | 42 ++++++++++-
integration-tests/azure-storage-queue/README.adoc | 16 +++++
.../azure-storage-queue}/pom.xml | 67 ++++++++++++++----
.../queue/it/AzureStorageQueueResource.java} | 64 ++++++++++-------
.../src/main/resources/application.properties | 4 +-
.../storage/queue/it/AzureStorageQueueIT.java | 19 ++---
.../storage/queue/it/AzureStorageQueueTest.java} | 33 ++++-----
.../component/azure/it/AzureBlobResource.java | 4 +-
.../component/azure/it/AzureQueueResource.java | 4 +-
.../src/main/resources/application.properties | 4 +-
.../component/azure/it/AzureTestResource.java | 4 +-
integration-tests/pom.xml | 1 +
poms/bom-test/pom.xml | 5 ++
tooling/scripts/test-categories.yaml | 1 +
32 files changed, 335 insertions(+), 275 deletions(-)
diff --git a/docs/modules/ROOT/pages/reference/extensions/azure-storage-queue.adoc b/docs/modules/ROOT/pages/reference/extensions/azure-storage-queue.adoc
index 322c9ee..9041680 100644
--- a/docs/modules/ROOT/pages/reference/extensions/azure-storage-queue.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/azure-storage-queue.adoc
@@ -2,15 +2,15 @@
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
= Azure Storage Queue Service
:cq-artifact-id: camel-quarkus-azure-storage-queue
-:cq-native-supported: false
-:cq-status: Preview
+:cq-native-supported: true
+:cq-status: Stable
:cq-description: The azure-storage-queue component is used for storing and retrieving the messages to/from Azure Storage Queue using Azure SDK v12.
:cq-deprecated: false
:cq-jvm-since: 1.1.0
-:cq-native-since: n/a
+:cq-native-since: 1.7.0
[.badges]
-[.badge-key]##JVM since##[.badge-supported]##1.1.0## [.badge-key]##Native##[.badge-unsupported]##unsupported##
+[.badge-key]##JVM since##[.badge-supported]##1.1.0## [.badge-key]##Native since##[.badge-supported]##1.7.0##
The azure-storage-queue component is used for storing and retrieving the messages to/from Azure Storage Queue using Azure SDK v12.
@@ -31,3 +31,9 @@ Please refer to the above link for usage and configuration details.
----
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
+
+== SSL in native mode
+
+This extension auto-enables SSL support in native mode. Hence you do not need to add
+`quarkus.ssl.native=true` to your `application.properties` yourself. See also
+https://quarkus.io/guides/native-and-ssl[Quarkus SSL guide].
diff --git a/docs/modules/ROOT/partials/reference/components/azure-storage-queue.adoc b/docs/modules/ROOT/partials/reference/components/azure-storage-queue.adoc
index 00e7a2f..accd13f 100644
--- a/docs/modules/ROOT/partials/reference/components/azure-storage-queue.adoc
+++ b/docs/modules/ROOT/partials/reference/components/azure-storage-queue.adoc
@@ -2,11 +2,11 @@
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
:cq-artifact-id: camel-quarkus-azure-storage-queue
:cq-artifact-id-base: azure-storage-queue
-:cq-native-supported: false
-:cq-status: Preview
+:cq-native-supported: true
+:cq-status: Stable
:cq-deprecated: false
:cq-jvm-since: 1.1.0
-:cq-native-since: n/a
+:cq-native-since: 1.7.0
:cq-camel-part-name: azure-storage-queue
:cq-camel-part-title: Azure Storage Queue Service
:cq-camel-part-description: The azure-storage-queue component is used for storing and retrieving the messages to/from Azure Storage Queue using Azure SDK v12.
diff --git a/extensions-jvm/azure-storage-queue/deployment/src/main/java/org/apache/camel/quarkus/component/azure/storage/queue/deployment/AzureStorageQueueProcessor.java b/extensions-jvm/azure-storage-queue/deployment/src/main/java/org/apache/camel/quarkus/component/azure/storage/queue/deployment/AzureStorageQueueProcessor.java
deleted file mode 100644
index c73cea3..0000000
--- a/extensions-jvm/azure-storage-queue/deployment/src/main/java/org/apache/camel/quarkus/component/azure/storage/queue/deployment/AzureStorageQueueProcessor.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.quarkus.component.azure.storage.queue.deployment;
-
-import io.quarkus.deployment.annotations.BuildStep;
-import io.quarkus.deployment.annotations.ExecutionTime;
-import io.quarkus.deployment.annotations.Record;
-import io.quarkus.deployment.builditem.FeatureBuildItem;
-import io.quarkus.deployment.pkg.steps.NativeBuild;
-import org.apache.camel.quarkus.core.JvmOnlyRecorder;
-import org.jboss.logging.Logger;
-
-class AzureStorageQueueProcessor {
-
- private static final Logger LOG = Logger.getLogger(AzureStorageQueueProcessor.class);
- private static final String FEATURE = "camel-azure-storage-queue";
-
- @BuildStep
- FeatureBuildItem feature() {
- return new FeatureBuildItem(FEATURE);
- }
-
- /**
- * Remove this once this extension starts supporting the native mode.
- */
- @BuildStep(onlyIf = NativeBuild.class)
- @Record(value = ExecutionTime.RUNTIME_INIT)
- void warnJvmInNative(JvmOnlyRecorder recorder) {
- JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time
- recorder.warnJvmInNative(FEATURE); // warn at runtime
- }
-}
diff --git a/extensions-jvm/azure-storage-queue/integration-test/src/main/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueResource.java b/extensions-jvm/azure-storage-queue/integration-test/src/main/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueResource.java
deleted file mode 100644
index 5b49ba4..0000000
--- a/extensions-jvm/azure-storage-queue/integration-test/src/main/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueResource.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.quarkus.component.azure.storage.queue.it;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.apache.camel.CamelContext;
-import org.jboss.logging.Logger;
-
-@Path("/azure-storage-queue")
-@ApplicationScoped
-public class AzureStorageQueueResource {
-
- private static final Logger LOG = Logger.getLogger(AzureStorageQueueResource.class);
-
- private static final String COMPONENT_AZURE_STORAGE_QUEUE = "azure-storage-queue";
- @Inject
- CamelContext context;
-
- @Path("/load/component/azure-storage-queue")
- @GET
- @Produces(MediaType.TEXT_PLAIN)
- public Response loadComponentAzureStorageQueue() throws Exception {
- /* This is an autogenerated test */
- if (context.getComponent(COMPONENT_AZURE_STORAGE_QUEUE) != null) {
- return Response.ok().build();
- }
- LOG.warnf("Could not load [%s] from the Camel context", COMPONENT_AZURE_STORAGE_QUEUE);
- return Response.status(500, COMPONENT_AZURE_STORAGE_QUEUE + " could not be loaded from the Camel context").build();
- }
-}
diff --git a/extensions-jvm/pom.xml b/extensions-jvm/pom.xml
index c855c2e..79aef61 100644
--- a/extensions-jvm/pom.xml
+++ b/extensions-jvm/pom.xml
@@ -43,7 +43,6 @@
<module>aws-xray</module>
<module>aws2-eventbridge</module>
<module>aws2-kinesis</module>
- <module>azure-storage-queue</module>
<module>barcode</module>
<module>beanio</module>
<module>beanstalk</module>
diff --git a/extensions-jvm/azure-storage-queue/deployment/pom.xml b/extensions/azure-storage-queue/deployment/pom.xml
similarity index 93%
copy from extensions-jvm/azure-storage-queue/deployment/pom.xml
copy to extensions/azure-storage-queue/deployment/pom.xml
index 47338e9..8631204 100644
--- a/extensions-jvm/azure-storage-queue/deployment/pom.xml
+++ b/extensions/azure-storage-queue/deployment/pom.xml
@@ -36,6 +36,10 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-support-reactor-netty-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-azure-storage-queue</artifactId>
</dependency>
</dependencies>
diff --git a/extensions/azure-storage-queue/deployment/src/main/java/org/apache/camel/quarkus/component/azure/storage/queue/deployment/AzureStorageQueueProcessor.java b/extensions/azure-storage-queue/deployment/src/main/java/org/apache/camel/quarkus/component/azure/storage/queue/deployment/AzureStorageQueueProcessor.java
new file mode 100644
index 0000000..643a9c6
--- /dev/null
+++ b/extensions/azure-storage-queue/deployment/src/main/java/org/apache/camel/quarkus/component/azure/storage/queue/deployment/AzureStorageQueueProcessor.java
@@ -0,0 +1,82 @@
+/*
+ * 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.quarkus.component.azure.storage.queue.deployment;
+
+import java.util.stream.Stream;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import org.jboss.jandex.ClassInfo;
+import org.jboss.jandex.DotName;
+import org.jboss.logging.Logger;
+
+class AzureStorageQueueProcessor {
+
+ private static final Logger LOG = Logger.getLogger(AzureStorageQueueProcessor.class);
+ private static final String FEATURE = "camel-azure-storage-queue";
+
+ @BuildStep
+ FeatureBuildItem feature() {
+ return new FeatureBuildItem(FEATURE);
+ }
+
+ @BuildStep
+ ExtensionSslNativeSupportBuildItem activateSslNativeSupport() {
+ return new ExtensionSslNativeSupportBuildItem(FEATURE);
+ }
+
+ @BuildStep
+ void proxyDefinitions(BuildProducer<NativeImageProxyDefinitionBuildItem> proxyDefinitions) {
+ Stream.of(
+ "com.azure.storage.queue.implementation.MessageIdsImpl$MessageIdsService",
+ "com.azure.storage.queue.implementation.MessagesImpl$MessagesService",
+ "com.azure.storage.queue.implementation.QueuesImpl$QueuesService",
+ "com.azure.storage.queue.implementation.ServicesImpl$ServicesService")
+ .map(NativeImageProxyDefinitionBuildItem::new)
+ .forEach(proxyDefinitions::produce);
+ }
+
+ @BuildStep
+ void reflectiveClasses(CombinedIndexBuildItem combinedIndex, BuildProducer<ReflectiveClassBuildItem> reflectiveClasses) {
+
+ final String[] modelClasses = combinedIndex
+ .getIndex()
+ .getKnownClasses()
+ .stream()
+ .map(ClassInfo::name)
+ .map(DotName::toString)
+ .filter(n -> n.startsWith("com.azure.storage.queue.implementation.models.")
+ || n.startsWith("com.azure.storage.queue.models."))
+ .sorted()
+ .toArray(String[]::new);
+ reflectiveClasses.produce(new ReflectiveClassBuildItem(true, true, modelClasses));
+
+ reflectiveClasses.produce(new ReflectiveClassBuildItem(false, false, "com.azure.core.util.DateTimeRfc1123"));
+
+ }
+
+ @BuildStep
+ IndexDependencyBuildItem indexDependency() {
+ return new IndexDependencyBuildItem("com.azure", "azure-storage-queue");
+ }
+}
diff --git a/extensions-jvm/azure-storage-queue/pom.xml b/extensions/azure-storage-queue/pom.xml
similarity index 97%
rename from extensions-jvm/azure-storage-queue/pom.xml
rename to extensions/azure-storage-queue/pom.xml
index a849cc1..8b14b08 100644
--- a/extensions-jvm/azure-storage-queue/pom.xml
+++ b/extensions/azure-storage-queue/pom.xml
@@ -33,6 +33,5 @@
<modules>
<module>deployment</module>
<module>runtime</module>
- <module>integration-test</module>
</modules>
</project>
diff --git a/extensions-jvm/azure-storage-queue/runtime/pom.xml b/extensions/azure-storage-queue/runtime/pom.xml
similarity index 94%
rename from extensions-jvm/azure-storage-queue/runtime/pom.xml
rename to extensions/azure-storage-queue/runtime/pom.xml
index 2491f31..3217c8f 100644
--- a/extensions-jvm/azure-storage-queue/runtime/pom.xml
+++ b/extensions/azure-storage-queue/runtime/pom.xml
@@ -32,6 +32,7 @@
<properties>
<camel.quarkus.jvmSince>1.1.0</camel.quarkus.jvmSince>
+ <camel.quarkus.nativeSince>1.7.0</camel.quarkus.nativeSince>
</properties>
<dependencyManagement>
@@ -52,6 +53,10 @@
<artifactId>camel-quarkus-core</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-support-reactor-netty</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-azure-storage-queue</artifactId>
</dependency>
diff --git a/extensions-jvm/azure-storage-queue/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/azure-storage-queue/runtime/src/main/resources/META-INF/quarkus-extension.yaml
similarity index 97%
rename from extensions-jvm/azure-storage-queue/runtime/src/main/resources/META-INF/quarkus-extension.yaml
rename to extensions/azure-storage-queue/runtime/src/main/resources/META-INF/quarkus-extension.yaml
index 1fffa59..9b3b4db 100644
--- a/extensions-jvm/azure-storage-queue/runtime/src/main/resources/META-INF/quarkus-extension.yaml
+++ b/extensions/azure-storage-queue/runtime/src/main/resources/META-INF/quarkus-extension.yaml
@@ -24,9 +24,8 @@
name: "Camel Azure Storage Queue Service"
description: "The azure-storage-queue component is used for storing and retrieving the messages to/from Azure Storage Queue using Azure SDK v12"
metadata:
- unlisted: true
guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/azure-storage-queue.html"
categories:
- "integration"
status:
- - "preview"
+ - "stable"
diff --git a/extensions/pom.xml b/extensions/pom.xml
index a718e40..a170f40 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -75,6 +75,7 @@
<module>aws2-translate</module>
<module>azure</module>
<module>azure-storage-blob</module>
+ <module>azure-storage-queue</module>
<module>base64</module>
<module>bean</module>
<module>bean-validator</module>
diff --git a/extensions-jvm/azure-storage-queue/deployment/pom.xml b/integration-tests-support/azure/pom.xml
similarity index 59%
rename from extensions-jvm/azure-storage-queue/deployment/pom.xml
rename to integration-tests-support/azure/pom.xml
index 47338e9..b6be7bc 100644
--- a/extensions-jvm/azure-storage-queue/deployment/pom.xml
+++ b/integration-tests-support/azure/pom.xml
@@ -18,44 +18,41 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-azure-storage-queue-parent</artifactId>
+ <artifactId>camel-quarkus-integration-tests-support</artifactId>
<version>1.7.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
+ <modelVersion>4.0.0</modelVersion>
- <artifactId>camel-quarkus-azure-storage-queue-deployment</artifactId>
- <name>Camel Quarkus :: Azure Storage Queue Service :: Deployment</name>
+ <artifactId>camel-quarkus-integration-tests-support-azure</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: Support :: Azure</name>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bom-test</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
<dependencies>
<dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-test-common</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-core-deployment</artifactId>
+ <artifactId>camel-quarkus-integration-testcontainers-support</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-azure-storage-queue</artifactId>
+ <artifactId>camel-quarkus-integration-test-support-mock-backend</artifactId>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <annotationProcessorPaths>
- <path>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-extension-processor</artifactId>
- <version>${quarkus.version}</version>
- </path>
- </annotationProcessorPaths>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
diff --git a/integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobTestResource.java b/integration-tests-support/azure/src/main/java/org/apache/camel/quarkus/test/support/azure/AzureStorageTestResource.java
similarity index 60%
rename from integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobTestResource.java
rename to integration-tests-support/azure/src/main/java/org/apache/camel/quarkus/test/support/azure/AzureStorageTestResource.java
index 8c9ec6c..c837f78 100644
--- a/integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobTestResource.java
+++ b/integration-tests-support/azure/src/main/java/org/apache/camel/quarkus/test/support/azure/AzureStorageTestResource.java
@@ -15,36 +15,29 @@
* limitations under the License.
*/
-package org.apache.camel.quarkus.component.azure.storage.blob.it;
+package org.apache.camel.quarkus.test.support.azure;
+import java.util.LinkedHashMap;
import java.util.Map;
import java.util.UUID;
-import com.azure.core.http.policy.HttpLogDetailLevel;
-import com.azure.core.http.policy.HttpLogOptions;
-import com.azure.storage.blob.BlobContainerClient;
-import com.azure.storage.blob.BlobServiceClient;
-import com.azure.storage.blob.BlobServiceClientBuilder;
-import com.azure.storage.common.StorageSharedKeyCredential;
import io.quarkus.runtime.configuration.ConfigUtils;
import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
import io.smallrye.config.SmallRyeConfig;
import org.apache.camel.quarkus.test.mock.backend.MockBackendUtils;
-import org.apache.camel.util.CollectionHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.containers.wait.strategy.Wait;
-public class AzureStorageBlobTestResource implements QuarkusTestResourceLifecycleManager {
- private static final Logger LOGGER = LoggerFactory.getLogger(AzureStorageBlobTestResource.class);
+public class AzureStorageTestResource implements QuarkusTestResourceLifecycleManager {
+ private static final Logger LOGGER = LoggerFactory.getLogger(AzureStorageTestResource.class);
private static final String AZURITE_IMAGE = "mcr.microsoft.com/azure-storage/azurite:3.9.0";
private static final int BLOB_SERVICE_PORT = 10000;
private static final int QUEUE_SERVICE_PORT = 10001;
private GenericContainer<?> container;
- private BlobContainerClient blobContainer;
@Override
public Map<String, String> start() {
@@ -58,11 +51,9 @@ public class AzureStorageBlobTestResource implements QuarkusTestResourceLifecycl
final String azureBlobContainername = "camel-quarkus-" + UUID.randomUUID().toString();
final String azureStorageAccountName = config
- .getValue("camel.component.azure-blob.credentials-account-name", String.class);
- final String azureStorageAccountKey = config
- .getValue("camel.component.azure-blob.credentials-account-key", String.class);
- final Map<String, String> result;
+ .getValue("azure.storage.account-name", String.class);
final boolean startMockBackend = MockBackendUtils.startMockBackend(false);
+ final Map<String, String> result = new LinkedHashMap<>();
if (startMockBackend && !realCredentialsProvided) {
MockBackendUtils.logMockBackendUsed();
try {
@@ -78,10 +69,9 @@ public class AzureStorageBlobTestResource implements QuarkusTestResourceLifecycl
final String queueServiceUrl = "http://" + container.getContainerIpAddress() + ":"
+ container.getMappedPort(QUEUE_SERVICE_PORT) + "/" + azureStorageAccountName;
- result = CollectionHelper.mapOf(
- "azure.blob.container.name", azureBlobContainername,
- "azure.blob.service.url", blobServiceUrl,
- "azure.queue.service.url", queueServiceUrl);
+ result.put("azure.blob.container.name", azureBlobContainername);
+ result.put("azure.blob.service.url", blobServiceUrl);
+ result.put("azure.queue.service.url", queueServiceUrl);
} catch (Exception e) {
throw new RuntimeException(e);
}
@@ -91,41 +81,21 @@ public class AzureStorageBlobTestResource implements QuarkusTestResourceLifecycl
"Set AZURE_STORAGE_ACCOUNT_NAME and AZURE_STORAGE_ACCOUNT_KEY env vars if you set CAMEL_QUARKUS_START_MOCK_BACKEND=false");
}
MockBackendUtils.logRealBackendUsed();
- result = CollectionHelper.mapOf(
- "azure.blob.container.name", azureBlobContainername,
- "azure.blob.service.url",
- "https://" + realAzureStorageAccountName + ".blob.core.windows.net",
- "azure.queue.service.url", "https://" + realAzureStorageAccountName + ".queue.core.windows.net");
+ result.put("azure.blob.container.name", azureBlobContainername);
+ result.put("azure.blob.service.url", "https://" + realAzureStorageAccountName + ".blob.core.windows.net");
+ result.put("azure.queue.service.url", "https://" + realAzureStorageAccountName + ".queue.core.windows.net");
}
-
- StorageSharedKeyCredential credentials = new StorageSharedKeyCredential(azureStorageAccountName,
- azureStorageAccountKey);
- BlobServiceClient client = new BlobServiceClientBuilder()
- .endpoint(result.get("azure.blob.service.url"))
- .credential(credentials)
- .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS).setPrettyPrintBody(true))
- .buildClient();
- blobContainer = client.getBlobContainerClient(azureBlobContainername);
- blobContainer.create();
return result;
}
@Override
public void stop() {
try {
- if (blobContainer != null) {
- blobContainer.delete();
+ if (container != null) {
+ container.stop();
}
} catch (Exception e) {
- throw new RuntimeException(e);
- } finally {
- try {
- if (container != null) {
- container.stop();
- }
- } catch (Exception e) {
- // ignored
- }
+ // ignored
}
}
}
diff --git a/integration-tests-support/pom.xml b/integration-tests-support/pom.xml
index e7faac3..840b405 100644
--- a/integration-tests-support/pom.xml
+++ b/integration-tests-support/pom.xml
@@ -36,6 +36,7 @@
</description>
<modules>
+ <module>azure</module>
<module>custom-dataformat</module>
<module>custom-log-component</module>
<module>custom-routes-collector</module>
diff --git a/integration-tests/azure-storage-blob/pom.xml b/integration-tests/azure-storage-blob/pom.xml
index 5c3bedd..0db13a6 100644
--- a/integration-tests/azure-storage-blob/pom.xml
+++ b/integration-tests/azure-storage-blob/pom.xml
@@ -64,12 +64,7 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-integration-testcontainers-support</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-integration-test-support-mock-backend</artifactId>
+ <artifactId>camel-quarkus-integration-tests-support-azure</artifactId>
<scope>test</scope>
</dependency>
diff --git a/integration-tests/azure-storage-blob/src/main/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobResource.java b/integration-tests/azure-storage-blob/src/main/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobResource.java
index 4a610fa..95e7bb0 100644
--- a/integration-tests/azure-storage-blob/src/main/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobResource.java
+++ b/integration-tests/azure-storage-blob/src/main/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobResource.java
@@ -50,10 +50,10 @@ public class AzureStorageBlobResource {
@Inject
ProducerTemplate producerTemplate;
- @ConfigProperty(name = "camel.component.azure-blob.credentials-account-name")
+ @ConfigProperty(name = "azure.storage.account-name")
String azureStorageAccountName;
- @ConfigProperty(name = "camel.component.azure-blob.credentials-account-key")
+ @ConfigProperty(name = "azure.storage.account-key")
String azureStorageAccountKey;
@ConfigProperty(name = "azure.blob.service.url")
diff --git a/integration-tests/azure-storage-blob/src/main/resources/application.properties b/integration-tests/azure-storage-blob/src/main/resources/application.properties
index b77557e..23c1c40 100644
--- a/integration-tests/azure-storage-blob/src/main/resources/application.properties
+++ b/integration-tests/azure-storage-blob/src/main/resources/application.properties
@@ -21,7 +21,5 @@
azurite.storage.account.name = devstoreaccount1
azurite.storage.account.key = Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==
-camel.component.azure-blob.credentials-account-name = ${AZURE_STORAGE_ACCOUNT_NAME:${azurite.storage.account.name}}
-camel.component.azure-blob.credentials-account-key = ${AZURE_STORAGE_ACCOUNT_KEY:${azurite.storage.account.key}}
-
-#quarkus.native.additional-build-args = --allow-incomplete-classpath,--report-unsupported-elements-at-runtime
+azure.storage.account-name = ${AZURE_STORAGE_ACCOUNT_NAME:${azurite.storage.account.name}}
+azure.storage.account-key = ${AZURE_STORAGE_ACCOUNT_KEY:${azurite.storage.account.key}}
diff --git a/integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobIT.java b/integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobIT.java
index 0f855a6..8e28b46 100644
--- a/integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobIT.java
+++ b/integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobIT.java
@@ -18,9 +18,10 @@ package org.apache.camel.quarkus.component.azure.storage.blob.it;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.NativeImageTest;
+import org.apache.camel.quarkus.test.support.azure.AzureStorageTestResource;
@NativeImageTest
-@QuarkusTestResource(AzureStorageBlobTestResource.class)
+@QuarkusTestResource(AzureStorageTestResource.class)
class AzureStorageBlobIT extends AzureStorageBlobTest {
}
diff --git a/integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobTest.java b/integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobTest.java
index de3d0ed..de63caf 100644
--- a/integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobTest.java
+++ b/integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobTest.java
@@ -16,18 +16,58 @@
*/
package org.apache.camel.quarkus.component.azure.storage.blob.it;
+import com.azure.core.http.policy.HttpLogDetailLevel;
+import com.azure.core.http.policy.HttpLogOptions;
+import com.azure.storage.blob.BlobContainerClient;
+import com.azure.storage.blob.BlobServiceClient;
+import com.azure.storage.blob.BlobServiceClientBuilder;
+import com.azure.storage.common.StorageSharedKeyCredential;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
+import org.apache.camel.quarkus.test.support.azure.AzureStorageTestResource;
+import org.eclipse.microprofile.config.Config;
+import org.eclipse.microprofile.config.ConfigProvider;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.hamcrest.core.Is.is;
@QuarkusTest
-@QuarkusTestResource(AzureStorageBlobTestResource.class)
+@QuarkusTestResource(AzureStorageTestResource.class)
class AzureStorageBlobTest {
+ @BeforeAll
+ static void beforeAll() {
+ blobContainer().create();
+ }
+
+ @AfterAll
+ static void afterAll() {
+ blobContainer().delete();
+ }
+
+ private static BlobContainerClient blobContainer() {
+ final Config config = ConfigProvider.getConfig();
+ final String azureStorageAccountName = config.getValue("azure.storage.account-name",
+ String.class);
+ final String azureStorageAccountKey = config
+ .getValue("azure.storage.account-key", String.class);
+
+ StorageSharedKeyCredential credentials = new StorageSharedKeyCredential(azureStorageAccountName,
+ azureStorageAccountKey);
+ BlobServiceClient client = new BlobServiceClientBuilder()
+ .endpoint(config.getValue("azure.blob.service.url", String.class))
+ .credential(credentials)
+ .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS).setPrettyPrintBody(true))
+ .buildClient();
+ BlobContainerClient blobContainer = client
+ .getBlobContainerClient(config.getValue("azure.blob.container.name", String.class));
+ return blobContainer;
+ }
+
@Test
public void crud() {
String blobContent = "Hello Camel Quarkus Azure Blob";
diff --git a/integration-tests/azure-storage-queue/README.adoc b/integration-tests/azure-storage-queue/README.adoc
new file mode 100644
index 0000000..db86b5c
--- /dev/null
+++ b/integration-tests/azure-storage-queue/README.adoc
@@ -0,0 +1,16 @@
+== Azure Storage Blob Service integration tests
+
+By default the integration tests run against a local https://github.com/Azure/Azurite[Azurite] container.
+
+To run the tests against the real remote Azure API, you need the following:
+
+* A https://docs.microsoft.com/en-us/azure/storage/common/storage-account-create?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&tabs=azure-portal[general-purpose v2 Azure storage account]
+* View the https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage?tabs=azure-portal#view-account-access-keys[account keys] and set the following environment variables:
++
+[source,shell]
+----
+export AZURE_STORAGE_ACCOUNT_NAME=my-account-name
+export AZURE_STORAGE_ACCOUNT_KEY=my-account-key
+----
+
+You may want to `export CAMEL_QUARKUS_START_MOCK_BACKEND=false` to avoid starting he the local Azurite container and make sure that you test against the real remote Azure API.
diff --git a/extensions-jvm/azure-storage-queue/integration-test/pom.xml b/integration-tests/azure-storage-queue/pom.xml
similarity index 53%
rename from extensions-jvm/azure-storage-queue/integration-test/pom.xml
rename to integration-tests/azure-storage-queue/pom.xml
index afc3f8d..f40032b 100644
--- a/extensions-jvm/azure-storage-queue/integration-test/pom.xml
+++ b/integration-tests/azure-storage-queue/pom.xml
@@ -21,25 +21,14 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-build-parent-it</artifactId>
+ <artifactId>camel-quarkus-integration-tests</artifactId>
<version>1.7.0-SNAPSHOT</version>
- <relativePath>../../../poms/build-parent-it/pom.xml</relativePath>
</parent>
- <artifactId>camel-quarkus-azure-storage-queue-integration-test</artifactId>
- <name>Camel Quarkus :: Azure Storage Queue Service :: Integration Test</name>
+ <artifactId>camel-quarkus-integration-test-azure-storage-queue</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: Azure Storage Queue Service</name>
<description>Integration tests for Camel Quarkus Azure Storage Queue Service extension</description>
- <properties>
- <!-- mvnd, a.k.a. Maven Daemon: https://github.com/mvndaemon/mvnd -->
- <!-- The following rule tells mvnd to build the listed deployment modules before this module. -->
- <!-- This is important because mvnd builds modules in parallel by default. The deployment modules are not -->
- <!-- explicit dependencies of this module in the Maven sense, although they are required by the Quarkus Maven plugin. -->
- <!-- Please update the rule whenever you change the dependencies of this module by running -->
- <!-- mvn process-resources -Pformat from the root directory -->
- <mvnd.builder.rule>camel-quarkus-azure-storage-queue-deployment,camel-quarkus-support-policy-deployment</mvnd.builder.rule>
- </properties>
-
<dependencyManagement>
<dependencies>
<dependency>
@@ -73,6 +62,56 @@
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-azure</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-azure-storage-queue-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
</dependencies>
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
</project>
diff --git a/integration-tests/azure/src/main/java/org/apache/camel/quarkus/component/azure/it/AzureQueueResource.java b/integration-tests/azure-storage-queue/src/main/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueResource.java
similarity index 54%
copy from integration-tests/azure/src/main/java/org/apache/camel/quarkus/component/azure/it/AzureQueueResource.java
copy to integration-tests/azure-storage-queue/src/main/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueResource.java
index 0407aa8..6947ad6 100644
--- a/integration-tests/azure/src/main/java/org/apache/camel/quarkus/component/azure/it/AzureQueueResource.java
+++ b/integration-tests/azure-storage-queue/src/main/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueResource.java
@@ -14,10 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.quarkus.component.azure.it;
+package org.apache.camel.quarkus.component.azure.storage.queue.it;
import java.net.URI;
+import java.util.List;
import java.util.UUID;
+import java.util.stream.Collectors;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
@@ -31,47 +33,53 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import com.microsoft.azure.storage.StorageCredentials;
-import com.microsoft.azure.storage.StorageCredentialsAccountAndKey;
-import com.microsoft.azure.storage.queue.CloudQueue;
-import com.microsoft.azure.storage.queue.CloudQueueMessage;
+import com.azure.core.http.policy.HttpLogDetailLevel;
+import com.azure.core.http.policy.HttpLogOptions;
+import com.azure.storage.common.StorageSharedKeyCredential;
+import com.azure.storage.queue.QueueServiceClient;
+import com.azure.storage.queue.QueueServiceClientBuilder;
+import com.azure.storage.queue.models.QueueMessageItem;
import io.quarkus.arc.Unremovable;
import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.azure.storage.queue.QueueOperationDefinition;
import org.eclipse.microprofile.config.inject.ConfigProperty;
-@Path("/azure")
+@Path("/azure-storage-queue")
@ApplicationScoped
-public class AzureQueueResource {
+public class AzureStorageQueueResource {
private static final String QUEUE_NAME = "camel-quarkus-" + UUID.randomUUID().toString();
@Inject
ProducerTemplate producerTemplate;
- @ConfigProperty(name = "camel.component.azure-blob.credentials-account-name")
+ @ConfigProperty(name = "azure.storage.account-name")
String azureStorageAccountName;
- @ConfigProperty(name = "camel.component.azure-blob.credentials-account-key")
+ @ConfigProperty(name = "azure.storage.account-key")
String azureStorageAccountKey;
@ConfigProperty(name = "azure.queue.service.url")
String azureQueueServiceUrl;
@javax.enterprise.inject.Produces
- @Named("azureQueueClient")
+ @Named("azureQueueServiceClient")
@Unremovable
- public CloudQueue createQueueClient() throws Exception {
- URI uri = new URI(azureQueueServiceUrl + "/" + QUEUE_NAME);
- StorageCredentials credentials = new StorageCredentialsAccountAndKey(azureStorageAccountName, azureStorageAccountKey);
- return new CloudQueue(uri, credentials);
+ public QueueServiceClient createQueueClient() throws Exception {
+ final StorageSharedKeyCredential credentials = new StorageSharedKeyCredential(azureStorageAccountName,
+ azureStorageAccountKey);
+ return new QueueServiceClientBuilder()
+ .endpoint(azureQueueServiceUrl)
+ .credential(credentials)
+ .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS).setPrettyPrintBody(true))
+ .buildClient();
+
}
@Path("/queue/create")
@POST
public Response createQueue() throws Exception {
- producerTemplate.sendBody(
- "azure-queue://" + azureStorageAccountName + "/" + QUEUE_NAME
- + "?operation=createQueue&azureQueueClient=#azureQueueClient&validateClientURI=false",
+ producerTemplate.sendBody(componentUri(QueueOperationDefinition.createQueue),
null);
return Response.created(new URI("https://camel.apache.org/")).build();
}
@@ -80,11 +88,11 @@ public class AzureQueueResource {
@GET
@Produces(MediaType.TEXT_PLAIN)
public String retrieveMessage() throws Exception {
- CloudQueueMessage message = producerTemplate.requestBody(
- "azure-queue://" + azureStorageAccountName + "/" + QUEUE_NAME
- + "?operation=retrieveMessage&azureQueueClient=#azureQueueClient&validateClientURI=false",
- null, CloudQueueMessage.class);
- return message.getMessageContentAsString();
+ @SuppressWarnings("unchecked")
+ List<QueueMessageItem> messages = producerTemplate.requestBody(
+ componentUri(QueueOperationDefinition.receiveMessages),
+ null, List.class);
+ return messages.stream().map(QueueMessageItem::getMessageText).collect(Collectors.joining("\n"));
}
@Path("/queue/message")
@@ -92,8 +100,7 @@ public class AzureQueueResource {
@Consumes(MediaType.TEXT_PLAIN)
public Response addMessage(String message) throws Exception {
producerTemplate.sendBody(
- "azure-queue://" + azureStorageAccountName + "/" + QUEUE_NAME
- + "?operation=addMessage&azureQueueClient=#azureQueueClient&validateClientURI=false",
+ componentUri(QueueOperationDefinition.sendMessage),
message);
return Response.created(new URI("https://camel.apache.org/")).build();
}
@@ -102,10 +109,15 @@ public class AzureQueueResource {
@DELETE
public Response deleteQueue() throws Exception {
producerTemplate.sendBody(
- "azure-queue://" + azureStorageAccountName + "/" + QUEUE_NAME
- + "?operation=deleteQueue&azureQueueClient=#azureQueueClient&validateClientURI=false",
+ componentUri(QueueOperationDefinition.deleteQueue),
null);
return Response.noContent().build();
}
+ private String componentUri(final QueueOperationDefinition operation) {
+ return String.format("azure-storage-queue://%s/%s?serviceClient=#azureQueueServiceClient&operation=%s",
+ azureStorageAccountName, QUEUE_NAME,
+ operation.name());
+ }
+
}
diff --git a/integration-tests/azure/src/main/resources/application.properties b/integration-tests/azure-storage-queue/src/main/resources/application.properties
similarity index 83%
copy from integration-tests/azure/src/main/resources/application.properties
copy to integration-tests/azure-storage-queue/src/main/resources/application.properties
index 8624940..23c1c40 100644
--- a/integration-tests/azure/src/main/resources/application.properties
+++ b/integration-tests/azure-storage-queue/src/main/resources/application.properties
@@ -21,5 +21,5 @@
azurite.storage.account.name = devstoreaccount1
azurite.storage.account.key = Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==
-camel.component.azure-blob.credentials-account-name = ${AZURE_STORAGE_ACCOUNT_NAME:${azurite.storage.account.name}}
-camel.component.azure-blob.credentials-account-key = ${AZURE_STORAGE_ACCOUNT_KEY:${azurite.storage.account.key}}
+azure.storage.account-name = ${AZURE_STORAGE_ACCOUNT_NAME:${azurite.storage.account.name}}
+azure.storage.account-key = ${AZURE_STORAGE_ACCOUNT_KEY:${azurite.storage.account.key}}
diff --git a/extensions-jvm/azure-storage-queue/integration-test/src/test/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueTest.java b/integration-tests/azure-storage-queue/src/test/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueIT.java
similarity index 68%
rename from extensions-jvm/azure-storage-queue/integration-test/src/test/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueTest.java
rename to integration-tests/azure-storage-queue/src/test/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueIT.java
index b11a368..53f9bde 100644
--- a/extensions-jvm/azure-storage-queue/integration-test/src/test/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueTest.java
+++ b/integration-tests/azure-storage-queue/src/test/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueIT.java
@@ -16,19 +16,12 @@
*/
package org.apache.camel.quarkus.component.azure.storage.queue.it;
-import io.quarkus.test.junit.QuarkusTest;
-import io.restassured.RestAssured;
-import org.junit.jupiter.api.Test;
+import io.quarkus.test.common.QuarkusTestResource;
+import io.quarkus.test.junit.NativeImageTest;
+import org.apache.camel.quarkus.test.support.azure.AzureStorageTestResource;
-@QuarkusTest
-class AzureStorageQueueTest {
-
- @Test
- public void loadComponentAzureStorageQueue() {
- /* A simple autogenerated test */
- RestAssured.get("/azure-storage-queue/load/component/azure-storage-queue")
- .then()
- .statusCode(200);
- }
+@NativeImageTest
+@QuarkusTestResource(AzureStorageTestResource.class)
+class AzureStorageQueueIT extends AzureStorageQueueTest {
}
diff --git a/integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobTest.java b/integration-tests/azure-storage-queue/src/test/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueTest.java
similarity index 64%
copy from integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobTest.java
copy to integration-tests/azure-storage-queue/src/test/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueTest.java
index de3d0ed..7e7bd0b 100644
--- a/integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobTest.java
+++ b/integration-tests/azure-storage-queue/src/test/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueTest.java
@@ -14,54 +14,47 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.quarkus.component.azure.storage.blob.it;
+package org.apache.camel.quarkus.component.azure.storage.queue.it;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
+import org.apache.camel.quarkus.test.support.azure.AzureStorageTestResource;
import org.junit.jupiter.api.Test;
import static org.hamcrest.core.Is.is;
@QuarkusTest
-@QuarkusTestResource(AzureStorageBlobTestResource.class)
-class AzureStorageBlobTest {
+@QuarkusTestResource(AzureStorageTestResource.class)
+class AzureStorageQueueTest {
@Test
public void crud() {
- String blobContent = "Hello Camel Quarkus Azure Blob";
+ String message = "Hello Camel Quarkus Azure Queue";
// Create
RestAssured.given()
.contentType(ContentType.TEXT)
- .body(blobContent)
- .post("/azure-storage-blob/blob/create")
+ .post("/azure-storage-queue/queue/create")
.then()
.statusCode(201);
- // Read
- RestAssured.get("/azure-storage-blob/blob/read")
- .then()
- .statusCode(200)
- .body(is(blobContent));
-
- // Update
- String updatedContent = blobContent + " updated";
RestAssured.given()
.contentType(ContentType.TEXT)
- .body(updatedContent)
- .patch("/azure-storage-blob/blob/update")
+ .body(message)
+ .post("/azure-storage-queue/queue/message")
.then()
- .statusCode(200);
+ .statusCode(201);
- RestAssured.get("/azure-storage-blob/blob/read")
+ // Read
+ RestAssured.get("/azure-storage-queue/queue/read")
.then()
.statusCode(200)
- .body(is(updatedContent));
+ .body(is(message));
// Delete
- RestAssured.delete("/azure-storage-blob/blob/delete")
+ RestAssured.delete("/azure-storage-queue/queue/delete")
.then()
.statusCode(204);
}
diff --git a/integration-tests/azure/src/main/java/org/apache/camel/quarkus/component/azure/it/AzureBlobResource.java b/integration-tests/azure/src/main/java/org/apache/camel/quarkus/component/azure/it/AzureBlobResource.java
index 825c544..0a2529e 100644
--- a/integration-tests/azure/src/main/java/org/apache/camel/quarkus/component/azure/it/AzureBlobResource.java
+++ b/integration-tests/azure/src/main/java/org/apache/camel/quarkus/component/azure/it/AzureBlobResource.java
@@ -50,10 +50,10 @@ public class AzureBlobResource {
@Inject
ProducerTemplate producerTemplate;
- @ConfigProperty(name = "camel.component.azure-blob.credentials-account-name")
+ @ConfigProperty(name = "azure.storage.account-name")
String azureStorageAccountName;
- @ConfigProperty(name = "camel.component.azure-blob.credentials-account-key")
+ @ConfigProperty(name = "azure.storage.account-key")
String azureStorageAccountKey;
@ConfigProperty(name = "azure.blob.service.url")
diff --git a/integration-tests/azure/src/main/java/org/apache/camel/quarkus/component/azure/it/AzureQueueResource.java b/integration-tests/azure/src/main/java/org/apache/camel/quarkus/component/azure/it/AzureQueueResource.java
index 0407aa8..511ace3 100644
--- a/integration-tests/azure/src/main/java/org/apache/camel/quarkus/component/azure/it/AzureQueueResource.java
+++ b/integration-tests/azure/src/main/java/org/apache/camel/quarkus/component/azure/it/AzureQueueResource.java
@@ -48,10 +48,10 @@ public class AzureQueueResource {
@Inject
ProducerTemplate producerTemplate;
- @ConfigProperty(name = "camel.component.azure-blob.credentials-account-name")
+ @ConfigProperty(name = "azure.storage.account-name")
String azureStorageAccountName;
- @ConfigProperty(name = "camel.component.azure-blob.credentials-account-key")
+ @ConfigProperty(name = "azure.storage.account-key")
String azureStorageAccountKey;
@ConfigProperty(name = "azure.queue.service.url")
diff --git a/integration-tests/azure/src/main/resources/application.properties b/integration-tests/azure/src/main/resources/application.properties
index 8624940..23c1c40 100644
--- a/integration-tests/azure/src/main/resources/application.properties
+++ b/integration-tests/azure/src/main/resources/application.properties
@@ -21,5 +21,5 @@
azurite.storage.account.name = devstoreaccount1
azurite.storage.account.key = Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==
-camel.component.azure-blob.credentials-account-name = ${AZURE_STORAGE_ACCOUNT_NAME:${azurite.storage.account.name}}
-camel.component.azure-blob.credentials-account-key = ${AZURE_STORAGE_ACCOUNT_KEY:${azurite.storage.account.key}}
+azure.storage.account-name = ${AZURE_STORAGE_ACCOUNT_NAME:${azurite.storage.account.name}}
+azure.storage.account-key = ${AZURE_STORAGE_ACCOUNT_KEY:${azurite.storage.account.key}}
diff --git a/integration-tests/azure/src/test/java/org/apache/camel/quarkus/component/azure/it/AzureTestResource.java b/integration-tests/azure/src/test/java/org/apache/camel/quarkus/component/azure/it/AzureTestResource.java
index 0f6696d..992c6b1 100644
--- a/integration-tests/azure/src/test/java/org/apache/camel/quarkus/component/azure/it/AzureTestResource.java
+++ b/integration-tests/azure/src/test/java/org/apache/camel/quarkus/component/azure/it/AzureTestResource.java
@@ -58,9 +58,9 @@ public class AzureTestResource implements QuarkusTestResourceLifecycleManager {
final String azureBlobContainername = "camel-quarkus-" + UUID.randomUUID().toString();
final String azureStorageAccountName = config
- .getValue("camel.component.azure-blob.credentials-account-name", String.class);
+ .getValue("azure.storage.account-name", String.class);
final String azureStorageAccountKey = config
- .getValue("camel.component.azure-blob.credentials-account-key", String.class);
+ .getValue("azure.storage.account-key", String.class);
final Map<String, String> result;
final boolean startMockBackend = MockBackendUtils.startMockBackend(false);
if (startMockBackend && !realCredentialsProvided) {
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index ab7b5b1..143d9f0 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -70,6 +70,7 @@
<module>aws2</module>
<module>azure</module>
<module>azure-storage-blob</module>
+ <module>azure-storage-queue</module>
<module>base64</module>
<module>bean</module>
<module>bean-validator</module>
diff --git a/poms/bom-test/pom.xml b/poms/bom-test/pom.xml
index cf7e17c..5923b9d 100644
--- a/poms/bom-test/pom.xml
+++ b/poms/bom-test/pom.xml
@@ -59,6 +59,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-azure</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-integration-tests-support-custom-log-component</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>
diff --git a/tooling/scripts/test-categories.yaml b/tooling/scripts/test-categories.yaml
index 557a079..32e4b92 100644
--- a/tooling/scripts/test-categories.yaml
+++ b/tooling/scripts/test-categories.yaml
@@ -108,6 +108,7 @@ dozer-social-azure:
- zendesk
- csimple
- azure-storage-blob
+ - azure-storage-queue
messaging-networking1:
- activemq
- amqp