You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by al...@apache.org on 2021/03/12 08:18:17 UTC

[camel-quarkus] branch master updated: openstack: added cinder volume tests #1943

This is an automated email from the ASF dual-hosted git repository.

aldettinger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


The following commit(s) were added to refs/heads/master by this push:
     new 64758e9  openstack: added cinder volume tests #1943
64758e9 is described below

commit 64758e97bacdc501c9e1a14c0cb7f056e4ff21f4
Author: aldettinger <al...@gmail.com>
AuthorDate: Thu Mar 11 21:16:16 2021 +0100

    openstack: added cinder volume tests #1943
---
 extensions-jvm/openstack/integration-test/pom.xml  |   9 ++
 .../it/OpenstackCinderVolumeResource.java          | 159 +++++++++++++++++++++
 .../component/openstack/it/OpenstackResource.java  |  13 --
 .../openstack/it/OpenStackTestResource.java        |  50 +++++++
 .../openstack/it/OpenstackCinderVolumeTest.java    |  58 ++++++++
 .../component/openstack/it/OpenstackTest.java      |   8 --
 .../test/resources/mappings/authv3_project.json    |  21 +++
 .../mappings/createVolume_multiattach.json         |  18 +++
 .../src/test/resources/mappings/volume.json        |  18 +++
 .../src/test/resources/mappings/volume_delete.json |  14 ++
 .../src/test/resources/mappings/volume_types.json  |  18 +++
 .../src/test/resources/mappings/volume_update.json |  14 ++
 .../src/test/resources/mappings/volumes.json       |  18 +++
 .../WireMockTestResourceLifecycleManager.java      |   9 ++
 14 files changed, 406 insertions(+), 21 deletions(-)

diff --git a/extensions-jvm/openstack/integration-test/pom.xml b/extensions-jvm/openstack/integration-test/pom.xml
index 0c52c7c..31cfe73 100644
--- a/extensions-jvm/openstack/integration-test/pom.xml
+++ b/extensions-jvm/openstack/integration-test/pom.xml
@@ -39,6 +39,10 @@
             <groupId>io.quarkus</groupId>
             <artifactId>quarkus-resteasy</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-api</artifactId>
+        </dependency>
 
         <!-- test dependencies -->
         <dependency>
@@ -51,6 +55,11 @@
             <artifactId>rest-assured</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-integration-wiremock-support</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>
diff --git a/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackCinderVolumeResource.java b/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackCinderVolumeResource.java
new file mode 100644
index 0000000..542dac4
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackCinderVolumeResource.java
@@ -0,0 +1,159 @@
+/*
+ * 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.openstack.it;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.openstack.cinder.CinderConstants;
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.jboss.logging.Logger;
+import org.openstack4j.api.Builders;
+import org.openstack4j.model.storage.block.Volume;
+import org.openstack4j.model.storage.block.VolumeAttachment;
+import org.openstack4j.model.storage.block.VolumeType;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+@Path("/openstack/cinder/volumes/")
+@ApplicationScoped
+public class OpenstackCinderVolumeResource {
+
+    private static final Logger LOG = Logger.getLogger(OpenstackCinderVolumeResource.class);
+
+    private static final String URI_FORMAT = "openstack-cinder://{{camel.openstack.test.host-url}}?username=user&password=secret&project=project&operation=%s&subsystem="
+            + CinderConstants.VOLUMES;
+
+    @Inject
+    ProducerTemplate template;
+
+    @Path("/createShouldSucceed")
+    @POST
+    public void createShouldSucceed() {
+        LOG.debug("Calling OpenstackCinderVolumeResource.createShouldSucceed()");
+
+        Volume in = Builders.volume().size(10).name("test_openstack4j").description("test").multiattach(true).build();
+
+        String uri = String.format(URI_FORMAT, OpenstackConstants.CREATE);
+        Volume out = template.requestBody(uri, in, Volume.class);
+
+        assertEquals(out.getSize(), 10);
+        assertEquals(out.multiattach(), Boolean.TRUE);
+    }
+
+    @Path("/getShouldSucceed")
+    @POST
+    public void getShouldSucceed() {
+        LOG.debug("Calling OpenstackCinderVolumeResource.getShouldSucceed()");
+
+        String uri = String.format(URI_FORMAT, OpenstackConstants.GET);
+        String id = "8a9287b7-4f4d-4213-8d75-63470f19f27c";
+        Volume out = template.requestBodyAndHeader(uri, null, CinderConstants.VOLUME_ID, id, Volume.class);
+
+        assertEquals(out.getId(), id);
+        assertEquals(out.getName(), "test-volume");
+        assertEquals(out.getDescription(), "a description");
+        assertNotNull(out.getCreated());
+        assertEquals(out.getZone(), "nova");
+        assertEquals(out.getSize(), 100);
+        assertEquals(out.getStatus(), Volume.Status.IN_USE);
+        assertEquals(out.getSnapshotId(), "22222222-2222-2222-2222-222222222222");
+        assertEquals(out.getSourceVolid(), "11111111-1111-1111-1111-111111111111");
+        assertEquals(out.getVolumeType(), "Gold");
+
+        assertNotNull(out.getMetaData());
+        Map<String, String> metadata = out.getMetaData();
+        assertEquals(metadata.get("readonly"), "False");
+        assertEquals(metadata.get("attached_mode"), "rw");
+
+        assertNotNull(out.getAttachments());
+        List<? extends VolumeAttachment> attachments = out.getAttachments();
+        assertEquals(1, attachments.size());
+        assertEquals(attachments.get(0).getDevice(), "/dev/vdd");
+        assertEquals(attachments.get(0).getHostname(), "myhost");
+        assertEquals(attachments.get(0).getId(), "8a9287b7-4f4d-4213-8d75-63470f19f27c");
+        assertEquals(attachments.get(0).getServerId(), "eaa6a54d-35c1-40ce-831d-bb61f991e1a9");
+        assertEquals(attachments.get(0).getVolumeId(), "8a9287b7-4f4d-4213-8d75-63470f19f27c");
+    }
+
+    @Path("/getAllShouldSucceed")
+    @POST
+    public void getAllShouldSucceed() {
+        LOG.debug("Calling OpenstackCinderVolumeResource.getAllShouldSucceed()");
+
+        String uri = String.format(URI_FORMAT, OpenstackConstants.GET_ALL);
+        Volume[] volumes = template.requestBody(uri, null, Volume[].class);
+
+        assertEquals(volumes.length, 3);
+        assertEquals(volumes[0].getTenantId(), "b0b5ed7ae06049688349fe43737796d4");
+    }
+
+    @Path("/getAllTypesShouldSucceed")
+    @POST
+    public void getAllTypesShouldSucceed() {
+        LOG.debug("Calling OpenstackCinderVolumeResource.getAllTypesShouldSucceed()");
+
+        String uri = String.format(URI_FORMAT, CinderConstants.GET_ALL_TYPES);
+        VolumeType[] volumeTypes = template.requestBody(uri, null, VolumeType[].class);
+
+        assertEquals(volumeTypes.length, 2);
+        assertEquals(volumeTypes[0].getId(), "6a65bc1b-197b-45bf-8056-9695dc82191f");
+        assertEquals(volumeTypes[0].getName(), "testVolume1");
+        assertNotNull(volumeTypes[0].getExtraSpecs());
+        assertEquals(volumeTypes[0].getExtraSpecs().get("capabilities"), "gpu");
+        assertEquals(volumeTypes[1].getId(), "10f00bb7-46d8-4f3f-b89b-702693a3dcdc");
+        assertEquals(volumeTypes[1].getName(), "testVolume2");
+        assertNotNull(volumeTypes[1].getExtraSpecs());
+        assertEquals(volumeTypes[1].getExtraSpecs().get("capabilities"), "gpu");
+    }
+
+    @Path("/updateShouldSucceed")
+    @POST
+    public void updateShouldSucceed() {
+        LOG.debug("Calling OpenstackCinderVolumeResource.updateShouldSucceed()");
+
+        Map<String, Object> headers = new HashMap<>();
+        headers.put(CinderConstants.VOLUME_ID, "fffab33e-38e8-4626-9fee-fe90f240ff0f");
+        headers.put(OpenstackConstants.NAME, "name");
+        headers.put(OpenstackConstants.DESCRIPTION, "description");
+        headers.put(CinderConstants.DESCRIPTION, 1024);
+        headers.put(CinderConstants.VOLUME_TYPE, "volume-type");
+        headers.put(CinderConstants.IMAGE_REF, "image-ref");
+        headers.put(CinderConstants.SNAPSHOT_ID, "snaphot-id");
+        headers.put(CinderConstants.IS_BOOTABLE, false);
+
+        String uri = String.format(URI_FORMAT, OpenstackConstants.UPDATE);
+        template.requestBodyAndHeaders(uri, null, headers);
+    }
+
+    @Path("/deleteShouldSucceed")
+    @POST
+    public void deleteShouldSucceed() {
+        LOG.debug("Calling OpenstackCinderVolumeResource.deleteShouldSucceed()");
+
+        String uri = String.format(URI_FORMAT, OpenstackConstants.DELETE);
+        template.requestBodyAndHeader(uri, null, CinderConstants.VOLUME_ID, "fffab33e-38e8-4626-9fee-fe90f240ff0f");
+    }
+}
diff --git a/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackResource.java b/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackResource.java
index 601c38d..50c04a6 100644
--- a/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackResource.java
+++ b/extensions-jvm/openstack/integration-test/src/main/java/org/apache/camel/quarkus/component/openstack/it/OpenstackResource.java
@@ -33,7 +33,6 @@ public class OpenstackResource {
 
     private static final Logger LOG = Logger.getLogger(OpenstackResource.class);
 
-    private static final String COMPONENT_OPENSTACK_CINDER = "openstack-cinder";
     private static final String COMPONENT_OPENSTACK_GLANCE = "openstack-glance";
     private static final String COMPONENT_OPENSTACK_KEYSTONE = "openstack-keystone";
     private static final String COMPONENT_OPENSTACK_NEUTRON = "openstack-neutron";
@@ -42,18 +41,6 @@ public class OpenstackResource {
     @Inject
     CamelContext context;
 
-    @Path("/load/component/openstack-cinder")
-    @GET
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response loadComponentOpenstackCinder() throws Exception {
-        /* This is an autogenerated test */
-        if (context.getComponent(COMPONENT_OPENSTACK_CINDER) != null) {
-            return Response.ok().build();
-        }
-        LOG.warnf("Could not load [%s] from the Camel context", COMPONENT_OPENSTACK_CINDER);
-        return Response.status(500, COMPONENT_OPENSTACK_CINDER + " could not be loaded from the Camel context").build();
-    }
-
     @Path("/load/component/openstack-glance")
     @GET
     @Produces(MediaType.TEXT_PLAIN)
diff --git a/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenStackTestResource.java b/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenStackTestResource.java
new file mode 100644
index 0000000..6d2011e
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenStackTestResource.java
@@ -0,0 +1,50 @@
+/*
+ * 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.openstack.it;
+
+import java.util.Map;
+
+import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
+import com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;
+import org.apache.camel.quarkus.test.wiremock.WireMockTestResourceLifecycleManager;
+
+public class OpenStackTestResource extends WireMockTestResourceLifecycleManager {
+
+    @Override
+    public Map<String, String> start() {
+        Map<String, String> properties = super.start();
+        String wiremockUrl = properties.get("wiremock.url");
+        properties.put("camel.openstack.test.host-url", wiremockUrl);
+        return properties;
+    }
+
+    @Override
+    protected String getRecordTargetBaseUrl() {
+        return null;
+    }
+
+    @Override
+    protected boolean isMockingEnabled() {
+        return true;
+    }
+
+    @Override
+    protected void customizeWiremockConfiguration(WireMockConfiguration config) {
+        config.extensions(new ResponseTemplateTransformer(false));
+    }
+
+}
diff --git a/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackCinderVolumeTest.java b/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackCinderVolumeTest.java
new file mode 100644
index 0000000..b3b316b
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackCinderVolumeTest.java
@@ -0,0 +1,58 @@
+/*
+ * 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.openstack.it;
+
+import io.quarkus.test.common.QuarkusTestResource;
+import io.quarkus.test.junit.QuarkusTest;
+import org.junit.jupiter.api.Test;
+
+import static io.restassured.RestAssured.post;
+
+@QuarkusTest
+@QuarkusTestResource(OpenStackTestResource.class)
+class OpenstackCinderVolumeTest {
+
+    @Test
+    public void createShouldSucceed() {
+        post("/openstack/cinder/volumes/createShouldSucceed").then().statusCode(204);
+    }
+
+    @Test
+    public void getShouldSucceed() {
+        post("/openstack/cinder/volumes/getShouldSucceed").then().statusCode(204);
+    }
+
+    @Test
+    public void getAllShouldSucceed() {
+        post("/openstack/cinder/volumes/getAllShouldSucceed").then().statusCode(204);
+    }
+
+    @Test
+    public void getAllTypesShouldSucceed() {
+        post("/openstack/cinder/volumes/getAllTypesShouldSucceed").then().statusCode(204);
+    }
+
+    @Test
+    public void updateShouldSucceed() {
+        post("/openstack/cinder/volumes/updateShouldSucceed").then().statusCode(204);
+    }
+
+    @Test
+    public void deleteShouldSucceed() {
+        post("/openstack/cinder/volumes/deleteShouldSucceed").then().statusCode(204);
+    }
+}
diff --git a/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackTest.java b/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackTest.java
index fa43017..30301a1 100644
--- a/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackTest.java
+++ b/extensions-jvm/openstack/integration-test/src/test/java/org/apache/camel/quarkus/component/openstack/it/OpenstackTest.java
@@ -24,14 +24,6 @@ import org.junit.jupiter.api.Test;
 class OpenstackTest {
 
     @Test
-    public void loadComponentOpenstackCinder() {
-        /* A simple autogenerated test */
-        RestAssured.get("/openstack/load/component/openstack-cinder")
-                .then()
-                .statusCode(200);
-    }
-
-    @Test
     public void loadComponentOpenstackGlance() {
         /* A simple autogenerated test */
         RestAssured.get("/openstack/load/component/openstack-glance")
diff --git a/extensions-jvm/openstack/integration-test/src/test/resources/mappings/authv3_project.json b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/authv3_project.json
new file mode 100644
index 0000000..8518aad
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/authv3_project.json
@@ -0,0 +1,21 @@
+{
+  "id" : "9598de76-ef2b-4e6e-9fc8-101100185ff7",
+  "name" : "authv3_project.json",
+  "request" : {
+    "url" : "/auth/tokens",
+    "method" : "POST"
+  },
+  "response" : {
+    "status" : 201,
+    "body" : "{\"token\":{\"methods\":[\"password\"],\"roles\":[{\"id\":\"6ead57f8ae124996af8b0beb72ff1007\",\"name\":\"admin\"}],\"expires_at\":\"2015-08-26T14:14:10.309926Z\",\"project\":{\"domain\":{\"id\":\"default\",\"name\":\"Default\"},\"id\":\"123ac695d4db400a9001b91bb3b8aa46\",\"name\":\"admin\"},\"catalog\":[{\"endpoints\":[{\"region_id\":\"RegionOne\",\"url\":\"{{request.baseUrl}}\",\"region\":\"RegionOne\",\"interface\":\"public\",\"id\":\"6e82c8912d3f49a09df51035681d564c\"}, [...]
+    "transformers": ["response-template"],
+    "headers" : {
+      "Content-Type" : "application/json; charset=UTF-8",
+      "X-Subject-Token" : "token",
+      "x-openstack-request-id" : "request-id"
+    }
+  },
+  "uuid" : "9598de76-ef2b-4e6e-9fc8-101100185ff7",
+  "persistent" : true,
+  "insertionIndex" : 1
+}
\ No newline at end of file
diff --git a/extensions-jvm/openstack/integration-test/src/test/resources/mappings/createVolume_multiattach.json b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/createVolume_multiattach.json
new file mode 100644
index 0000000..49e8cef
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/createVolume_multiattach.json
@@ -0,0 +1,18 @@
+{
+  "id" : "64cb434b-c6fa-4e5b-b330-863738c56727",
+  "name" : "createVolume_multiattach.json",
+  "request" : {
+    "url" : "/v2/123ac695d4db400a9001b91bb3b8aa46/volumes",
+    "method" : "POST"
+  },
+  "response" : {
+    "status" : 201,
+    "body" : "{\"volume\":{\"id\":\"ac9ae248-cf21-4301-87b1-568ff20a0a02\",\"status\":\"creating\",\"size\":10,\"zone\":\"nova\",\"created\":\"Wed Aug 16 13:27:14 KST 2017\",\"multiattach\":true,\"metadata\":{},\"bootable\":false}}",
+    "headers" : {
+      "Content-Type" : "application/json; charset=UTF-8"
+    }
+  },
+  "uuid" : "64cb434b-c6fa-4e5b-b330-863738c56727",
+  "persistent" : true,
+  "insertionIndex" : 1
+}
\ No newline at end of file
diff --git a/extensions-jvm/openstack/integration-test/src/test/resources/mappings/volume.json b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/volume.json
new file mode 100644
index 0000000..8b07cbb
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/volume.json
@@ -0,0 +1,18 @@
+{
+  "id" : "cae93cbc-a4a5-4fd8-b1a8-e66fbee24b0c",
+  "name" : "volume.json",
+  "request" : {
+    "url" : "/v2/123ac695d4db400a9001b91bb3b8aa46/volumes/8a9287b7-4f4d-4213-8d75-63470f19f27c",
+    "method" : "GET"
+  },
+  "response" : {
+    "status" : 200,
+    "body" : "{\"volume\":{\"status\":\"in-use\",\"user_id\":\"92ac3530a6cb4d47aa406f1c2c90fca4\",\"attachments\":[{\"host_name\":\"myhost\",\"device\":\"\/dev\/vdd\",\"server_id\":\"eaa6a54d-35c1-40ce-831d-bb61f991e1a9\",\"id\":\"8a9287b7-4f4d-4213-8d75-63470f19f27c\",\"volume_id\":\"8a9287b7-4f4d-4213-8d75-63470f19f27c\"}],\"links\":[{\"href\":\"http:\/\/example.com.com:8776\/v2\/b0b5ed7ae06049688349fe43737796d4\/volumes\/8a9287b7-4f4d-4213-8d75-63470f19f27c\",\"rel\":\"self\"},{\"href [...]
+    "headers" : {
+      "Content-Type" : "application/json; charset=UTF-8"
+    }
+  },
+  "uuid" : "cae93cbc-a4a5-4fd8-b1a8-e66fbee24b0c",
+  "persistent" : true,
+  "insertionIndex" : 1
+}
\ No newline at end of file
diff --git a/extensions-jvm/openstack/integration-test/src/test/resources/mappings/volume_delete.json b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/volume_delete.json
new file mode 100644
index 0000000..bca3c9a
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/volume_delete.json
@@ -0,0 +1,14 @@
+{
+  "id" : "543610ac-12c1-4b4e-9038-6287e97e3290",
+  "name" : "volume_delete.json",
+  "request" : {
+    "url" : "/v2/123ac695d4db400a9001b91bb3b8aa46/volumes/fffab33e-38e8-4626-9fee-fe90f240ff0f",
+    "method" : "DELETE"
+  },
+  "response" : {
+    "status" : 200
+  },
+  "uuid" : "543610ac-12c1-4b4e-9038-6287e97e3290",
+  "persistent" : true,
+  "insertionIndex" : 1
+}
\ No newline at end of file
diff --git a/extensions-jvm/openstack/integration-test/src/test/resources/mappings/volume_types.json b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/volume_types.json
new file mode 100644
index 0000000..44b6b13
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/volume_types.json
@@ -0,0 +1,18 @@
+{
+  "id" : "c209385d-c0d3-4e22-80ee-36f5b6ae5cb2",
+  "name" : "volume_types.json",
+  "request" : {
+    "url" : "/v2/123ac695d4db400a9001b91bb3b8aa46/types",
+    "method" : "GET"
+  },
+  "response" : {
+    "status" : 200,
+    "body" : "{\"volume_types\":[{\"id\":\"6a65bc1b-197b-45bf-8056-9695dc82191f\",\"name\":\"testVolume1\",\"extra_specs\":{\"capabilities\":\"gpu\"}},{\"id\":\"10f00bb7-46d8-4f3f-b89b-702693a3dcdc\",\"name\":\"testVolume2\",\"extra_specs\":{\"capabilities\":\"gpu\"}}]}",
+    "headers" : {
+      "Content-Type" : "application/json; charset=UTF-8"
+    }
+  },
+  "uuid" : "c209385d-c0d3-4e22-80ee-36f5b6ae5cb2",
+  "persistent" : true,
+  "insertionIndex" : 1
+}
\ No newline at end of file
diff --git a/extensions-jvm/openstack/integration-test/src/test/resources/mappings/volume_update.json b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/volume_update.json
new file mode 100644
index 0000000..4f7b7ce
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/volume_update.json
@@ -0,0 +1,14 @@
+{
+  "id" : "c1f37da4-4ef7-457c-a1e6-07dd63a440a9",
+  "name" : "volume_update.json",
+  "request" : {
+    "url" : "/v2/123ac695d4db400a9001b91bb3b8aa46/volumes/fffab33e-38e8-4626-9fee-fe90f240ff0f",
+    "method" : "PUT"
+  },
+  "response" : {
+    "status" : 200
+  },
+  "uuid" : "c1f37da4-4ef7-457c-a1e6-07dd63a440a9",
+  "persistent" : true,
+  "insertionIndex" : 1
+}
\ No newline at end of file
diff --git a/extensions-jvm/openstack/integration-test/src/test/resources/mappings/volumes.json b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/volumes.json
new file mode 100644
index 0000000..9cf4df6
--- /dev/null
+++ b/extensions-jvm/openstack/integration-test/src/test/resources/mappings/volumes.json
@@ -0,0 +1,18 @@
+{
+  "id" : "e39b2a5b-cf73-424b-a3d9-064c38b70388",
+  "name" : "volumes.json",
+  "request" : {
+    "url" : "/v2/123ac695d4db400a9001b91bb3b8aa46/volumes/detail",
+    "method" : "GET"
+  },
+  "response" : {
+    "status" : 200,
+    "body" : "{\"volumes\":[{\"status\":\"in-use\",\"display_name\":\"vol-snap-vol-test1\",\"attachments\":[{\"host_name\":null,\"device\":\"\/dev\/vdd\",\"server_id\":\"108b91cd-1adc-4799-b467-a7ec6fcd8ee7\",\"id\":\"725ee1cc-7599-42f2-a8fb-eca5ba10dadc\",\"volume_id\":\"725ee1cc-7599-42f2-a8fb-eca5ba10dadc\"}],\"availability_zone\":\"nova\",\"bootable\":\"false\",\"encrypted\":false,\"created_at\":\"2015-04-23T12:39:31.323376\",\"os-vol-tenant-attr:tenant_id\":\"b0b5ed7ae06049688349fe4 [...]
+    "headers" : {
+      "Content-Type" : "application/json; charset=UTF-8"
+    }
+  },
+  "uuid" : "e39b2a5b-cf73-424b-a3d9-064c38b70388",
+  "persistent" : true,
+  "insertionIndex" : 1
+}
\ No newline at end of file
diff --git a/integration-tests-support/wiremock/src/main/java/org/apache/camel/quarkus/test/wiremock/WireMockTestResourceLifecycleManager.java b/integration-tests-support/wiremock/src/main/java/org/apache/camel/quarkus/test/wiremock/WireMockTestResourceLifecycleManager.java
index 9774c9d..d3c6066 100644
--- a/integration-tests-support/wiremock/src/main/java/org/apache/camel/quarkus/test/wiremock/WireMockTestResourceLifecycleManager.java
+++ b/integration-tests-support/wiremock/src/main/java/org/apache/camel/quarkus/test/wiremock/WireMockTestResourceLifecycleManager.java
@@ -197,13 +197,22 @@ public abstract class WireMockTestResourceLifecycleManager implements QuarkusTes
     protected abstract boolean isMockingEnabled();
 
     /**
+     * Customizes the {@link WiremockConfiguration} that will be used to create the next {@Link WireMockServer}.
+     */
+    protected void customizeWiremockConfiguration(WireMockConfiguration config) {
+    }
+
+    /**
      * Creates and starts a {@link WireMockServer} on a random port. {@link MockBackendUtils} triggers the log
      * message that signifies mocking is in use.
      */
     private WireMockServer createServer() {
         LOG.info("Starting WireMockServer");
+
         MockBackendUtils.startMockBackend(true);
         WireMockConfiguration configuration = options().dynamicPort();
+        customizeWiremockConfiguration(configuration);
+
         if (!isRecordingEnabled()) {
             // Read mapping resources from the classpath in playback mode
             configuration.fileSource(new CamelQuarkusFileSource());