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.git
The following commit(s) were added to refs/heads/master by this push:
new 06e4207 CAMEL-16445: added some wiremock local integration tests
based on openstack4j test data
06e4207 is described below
commit 06e4207b1394f7ecc5c81ec44d4867792b229a38
Author: aldettinger <[email protected]>
AuthorDate: Fri Apr 2 11:42:03 2021 +0200
CAMEL-16445: added some wiremock local integration tests based on
openstack4j test data
---
components/camel-openstack/pom.xml | 13 ++
.../openstack/it/OpenstackCinderSnapshotTest.java | 48 ++++++++
.../openstack/it/OpenstackCinderVolumeTest.java | 129 ++++++++++++++++++++
.../openstack/it/OpenstackGlanceTest.java | 103 ++++++++++++++++
.../openstack/it/OpenstackKeystoneDomainTest.java | 95 +++++++++++++++
.../openstack/it/OpenstackKeystoneGroupTest.java | 133 +++++++++++++++++++++
.../openstack/it/OpenstackKeystoneProjectTest.java | 117 ++++++++++++++++++
.../openstack/it/OpenstackKeystoneRegionTest.java | 103 ++++++++++++++++
.../openstack/it/OpenstackKeystoneUserTest.java | 98 +++++++++++++++
.../openstack/it/OpenstackNeutronNetworkTest.java | 85 +++++++++++++
.../openstack/it/OpenstackNeutronPortTest.java | 65 ++++++++++
.../openstack/it/OpenstackNeutronSubnetTest.java | 51 ++++++++
.../openstack/it/OpenstackNovaFlavorTest.java | 84 +++++++++++++
.../openstack/it/OpenstackNovaServerTest.java | 98 +++++++++++++++
.../openstack/it/OpenstackSwiftContainerTest.java | 61 ++++++++++
.../openstack/it/OpenstackSwiftObjectTest.java | 54 +++++++++
.../openstack/it/OpenstackWiremockTestSupport.java | 52 ++++++++
.../mappings/cinder/snapshot/volume_snapshots.json | 18 +++
.../cinder/volume/createVolume_multiattach.json | 18 +++
.../resources/mappings/cinder/volume/volume.json | 18 +++
.../mappings/cinder/volume/volume_delete.json | 14 +++
.../mappings/cinder/volume/volume_types.json | 18 +++
.../mappings/cinder/volume/volume_update.json | 14 +++
.../resources/mappings/cinder/volume/volumes.json | 18 +++
.../src/test/resources/mappings/glance/image.json | 18 +++
.../resources/mappings/glance/image_delete.json | 14 +++
.../resources/mappings/glance/image_upload.json | 18 +++
.../src/test/resources/mappings/glance/images.json | 18 +++
.../resources/mappings/glance/images_detail.json | 18 +++
.../mappings/keystone/authv3_project.json | 21 ++++
.../keystone/domains/domains_create_response.json | 18 +++
.../mappings/keystone/domains/domains_delete.json | 20 ++++
.../keystone/domains/domains_get_byId.json | 19 +++
.../keystone/domains/domains_update_response.json | 18 +++
.../keystone/domains/domains_with_options.json | 18 +++
.../mappings/keystone/groups/groups_add_user.json | 20 ++++
.../keystone/groups/groups_check_user.json | 20 ++++
.../keystone/groups/groups_create_response.json | 18 +++
.../mappings/keystone/groups/groups_delete.json | 20 ++++
.../mappings/keystone/groups/groups_get_byId.json | 18 +++
.../mappings/keystone/groups/groups_list.json | 22 ++++
.../keystone/groups/groups_remove_user.json | 20 ++++
.../keystone/groups/groups_update_response.json | 18 +++
.../projects/projects_create_response.json | 18 +++
.../keystone/projects/projects_delete.json | 20 ++++
.../keystone/projects/projects_get_byId.json | 18 +++
.../projects/projects_update_response.json | 18 +++
.../keystone/projects/projects_with_options.json | 18 +++
.../keystone/regions/regions_create_response.json | 18 +++
.../mappings/keystone/regions/regions_delete.json | 20 ++++
.../keystone/regions/regions_get_byId.json | 18 +++
.../keystone/regions/regions_get_nonExistent.json | 22 ++++
.../mappings/keystone/regions/regions_list.json | 22 ++++
.../keystone/regions/regions_update_response.json | 18 +++
.../mappings/keystone/users/create_user.json | 18 +++
.../mappings/keystone/users/update_user.json | 18 +++
.../mappings/keystone/users/user_delete.json | 20 ++++
.../mappings/keystone/users/user_get_byId.json | 18 +++
.../resources/mappings/keystone/users/users.json | 22 ++++
.../mappings/neutron/networks/network.json | 18 +++
.../mappings/neutron/networks/network_delete.json | 20 ++++
.../neutron/networks/network_external.json | 18 +++
.../neutron/networks/networks_filtered.json | 22 ++++
.../mappings/neutron/ports/port_external.json | 18 +++
.../mappings/neutron/ports/ports_external.json | 22 ++++
.../mappings/neutron/subnets/subnet_ipv6.json | 18 +++
.../resources/mappings/nova/flavors/flavor.json | 18 +++
.../mappings/nova/flavors/flavor_create.json | 18 +++
.../mappings/nova/flavors/flavors_detailed.json | 22 ++++
.../mappings/nova/servers/server_create.json | 18 +++
.../nova/servers/server_snapshot_create.json | 17 +++
.../mappings/nova/servers/server_wrong_id_get.json | 18 +++
.../resources/mappings/nova/servers/servers.json | 22 ++++
.../swift/containers/container_metadata_get.json | 18 +++
.../mappings/swift/containers/containers.json | 22 ++++
.../mappings/swift/objects/object_get.json | 19 +++
76 files changed, 2497 insertions(+)
diff --git a/components/camel-openstack/pom.xml
b/components/camel-openstack/pom.xml
index cbfdd23..48c9149 100644
--- a/components/camel-openstack/pom.xml
+++ b/components/camel-openstack/pom.xml
@@ -64,6 +64,19 @@
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
+ <!-- Override the guava version prescribed by Camel with the one
needed by wiremock for tests -->
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>29.0-jre</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.github.tomakehurst</groupId>
+ <artifactId>wiremock-jre8</artifactId>
+ <version>${wiremock-version}</version>
+ <scope>test</scope>
+ </dependency>
<!-- logging -->
<dependency>
diff --git
a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackCinderSnapshotTest.java
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackCinderSnapshotTest.java
new file mode 100644
index 0000000..367f943
--- /dev/null
+++
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackCinderSnapshotTest.java
@@ -0,0 +1,48 @@
+/*
+ * 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.openstack.it;
+
+import org.apache.camel.component.openstack.cinder.CinderConstants;
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.junit.jupiter.api.Test;
+import org.openstack4j.model.storage.block.VolumeSnapshot;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class OpenstackCinderSnapshotTest extends OpenstackWiremockTestSupport {
+
+ private static final String URI_FORMAT
+ =
"openstack-cinder://%s?username=user&password=secret&project=project&operation=%s&subsystem="
+ + CinderConstants.SNAPSHOTS;
+
+ @Test
+ void getAllShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.GET_ALL);
+ VolumeSnapshot[] volumeSnapshots = template.requestBody(uri, null,
VolumeSnapshot[].class);
+
+ assertEquals(2, volumeSnapshots.length);
+ assertEquals("a06b0531-c14b-4a7b-8749-de1378dd1007",
volumeSnapshots[0].getId());
+ assertEquals("b0e394e6-bb10-4bfe-960d-edf72100c810",
volumeSnapshots[0].getVolumeId());
+ assertNotNull(volumeSnapshots[0].getMetaData());
+ assertTrue(volumeSnapshots[0].getMetaData().isEmpty());
+ assertEquals("6489c55f-b9f4-442e-8d0a-5a87349d2d07",
volumeSnapshots[1].getId());
+ assertEquals("7f47ab73-303c-4a19-b311-6123bb115775",
volumeSnapshots[1].getVolumeId());
+ }
+
+}
diff --git
a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackCinderVolumeTest.java
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackCinderVolumeTest.java
new file mode 100644
index 0000000..e7faa80
--- /dev/null
+++
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackCinderVolumeTest.java
@@ -0,0 +1,129 @@
+/*
+ * 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.openstack.it;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.camel.component.openstack.cinder.CinderConstants;
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.junit.jupiter.api.Test;
+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;
+
+public class OpenstackCinderVolumeTest extends OpenstackWiremockTestSupport {
+
+ private static final String URI_FORMAT
+ =
"openstack-cinder://%s?username=user&password=secret&project=project&operation=%s&subsystem="
+ + CinderConstants.VOLUMES;
+
+ @Test
+ void createShouldSucceed() {
+ Volume in =
Builders.volume().size(10).name("test_openstack4j").description("test").multiattach(true).build();
+
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.CREATE);
+ Volume out = template.requestBody(uri, in, Volume.class);
+
+ assertEquals(10, out.getSize());
+ assertEquals(Boolean.TRUE, out.multiattach());
+ }
+
+ @Test
+ void getShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(), OpenstackConstants.GET);
+ String id = "8a9287b7-4f4d-4213-8d75-63470f19f27c";
+ Volume out = template.requestBodyAndHeader(uri, null,
CinderConstants.VOLUME_ID, id, Volume.class);
+
+ assertEquals(id, out.getId());
+ assertEquals("test-volume", out.getName());
+ assertEquals("a description", out.getDescription());
+ assertNotNull(out.getCreated());
+ assertEquals("nova", out.getZone());
+ assertEquals(100, out.getSize());
+ assertEquals(Volume.Status.IN_USE, out.getStatus());
+ assertEquals("22222222-2222-2222-2222-222222222222",
out.getSnapshotId());
+ assertEquals("11111111-1111-1111-1111-111111111111",
out.getSourceVolid());
+ assertEquals("Gold", out.getVolumeType());
+
+ assertNotNull(out.getMetaData());
+ Map<String, String> metadata = out.getMetaData();
+ assertEquals("False", metadata.get("readonly"));
+ assertEquals("rw", metadata.get("attached_mode"));
+
+ assertNotNull(out.getAttachments());
+ List<? extends VolumeAttachment> attachments = out.getAttachments();
+ assertEquals(1, attachments.size());
+ assertEquals("/dev/vdd", attachments.get(0).getDevice());
+ assertEquals("myhost", attachments.get(0).getHostname());
+ assertEquals("8a9287b7-4f4d-4213-8d75-63470f19f27c",
attachments.get(0).getId());
+ assertEquals("eaa6a54d-35c1-40ce-831d-bb61f991e1a9",
attachments.get(0).getServerId());
+ assertEquals("8a9287b7-4f4d-4213-8d75-63470f19f27c",
attachments.get(0).getVolumeId());
+ }
+
+ @Test
+ void getAllShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.GET_ALL);
+ Volume[] volumes = template.requestBody(uri, null, Volume[].class);
+
+ assertEquals(3, volumes.length);
+ assertEquals("b0b5ed7ae06049688349fe43737796d4",
volumes[0].getTenantId());
+ }
+
+ @Test
+ void getAllTypesShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
CinderConstants.GET_ALL_TYPES);
+ VolumeType[] volumeTypes = template.requestBody(uri, null,
VolumeType[].class);
+
+ assertEquals(2, volumeTypes.length);
+ assertEquals("6a65bc1b-197b-45bf-8056-9695dc82191f",
volumeTypes[0].getId());
+ assertEquals("testVolume1", volumeTypes[0].getName());
+ assertNotNull(volumeTypes[0].getExtraSpecs());
+ assertEquals("gpu",
volumeTypes[0].getExtraSpecs().get("capabilities"));
+ assertEquals("10f00bb7-46d8-4f3f-b89b-702693a3dcdc",
volumeTypes[1].getId());
+ assertEquals("testVolume2", volumeTypes[1].getName());
+ assertNotNull(volumeTypes[1].getExtraSpecs());
+ assertEquals("gpu",
volumeTypes[1].getExtraSpecs().get("capabilities"));
+ }
+
+ @Test
+ void 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, url(),
OpenstackConstants.UPDATE);
+ template.requestBodyAndHeaders(uri, null, headers);
+ }
+
+ @Test
+ void deleteShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.DELETE);
+ template.requestBodyAndHeader(uri, null, CinderConstants.VOLUME_ID,
"fffab33e-38e8-4626-9fee-fe90f240ff0f");
+ }
+}
diff --git
a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackGlanceTest.java
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackGlanceTest.java
new file mode 100644
index 0000000..4c8f5b5
--- /dev/null
+++
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackGlanceTest.java
@@ -0,0 +1,103 @@
+/*
+ * 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.openstack.it;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.apache.camel.component.openstack.glance.GlanceConstants;
+import org.junit.jupiter.api.Test;
+import org.openstack4j.model.common.Payload;
+import org.openstack4j.model.common.Payloads;
+import org.openstack4j.model.image.ContainerFormat;
+import org.openstack4j.model.image.DiskFormat;
+import org.openstack4j.model.image.Image;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+public class OpenstackGlanceTest extends OpenstackWiremockTestSupport {
+
+ private static final String URI_FORMAT =
"openstack-glance://%s?username=user&password=secret&project=project&operation=%s";
+
+ @Test
+ void createShouldSucceed() {
+ Map<String, Object> headers = new HashMap<>();
+ headers.put(OpenstackConstants.NAME, "amphora-x64-haproxy");
+ headers.put(GlanceConstants.DISK_FORMAT, DiskFormat.QCOW2);
+ headers.put(GlanceConstants.CONTAINER_FORMAT, ContainerFormat.BARE);
+ headers.put(GlanceConstants.MIN_DISK, 0L);
+ headers.put(GlanceConstants.MIN_RAM, 0L);
+
+ Payload<InputStream> payload = Payloads.create(new
ByteArrayInputStream(new byte[] { 10, 11, 12 }));
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.CREATE);
+ Image out = template.requestBodyAndHeaders(uri, payload, headers,
Image.class);
+
+ assertNotNull(out);
+ assertEquals("8a2ea42d-06b5-42c2-a54d-97105420f2bb", out.getId());
+ assertEquals("amphora-x64-haproxy", out.getName());
+ assertEquals(ContainerFormat.BARE, out.getContainerFormat());
+ assertEquals(DiskFormat.QCOW2, out.getDiskFormat());
+ assertEquals(0L, out.getMinDisk());
+ assertEquals(0L, out.getMinRam());
+ }
+
+ @Test
+ void uploadShouldSucceed() {
+ Map<String, Object> headers = new HashMap<>();
+ headers.put(OpenstackConstants.NAME, "amphora-x64-haproxy");
+ headers.put(OpenstackConstants.ID,
"4b434528-032b-4467-946c-b5880ce15c06");
+ headers.put(GlanceConstants.DISK_FORMAT, DiskFormat.QCOW2);
+ headers.put(GlanceConstants.CONTAINER_FORMAT, ContainerFormat.BARE);
+ headers.put(GlanceConstants.MIN_DISK, 0L);
+ headers.put(GlanceConstants.MIN_RAM, 0L);
+
+ Payload<InputStream> payload = Payloads.create(new
ByteArrayInputStream(new byte[] { 10, 11, 12 }));
+ String uri = String.format(URI_FORMAT, url(), GlanceConstants.UPLOAD);
+ Image out = template.requestBodyAndHeaders(uri, payload, headers,
Image.class);
+
+ assertNotNull(out);
+ assertEquals("4b434528-032b-4467-946c-b5880ce15c06", out.getId());
+ }
+
+ @Test
+ void getShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(), OpenstackConstants.GET);
+ String id = "8a2ea42d-06b5-42c2-a54d-97105420f2bb";
+ Image out = template.requestBodyAndHeader(uri, null,
OpenstackConstants.ID, id, Image.class);
+
+ assertEquals(id, out.getId());
+ }
+
+ @Test
+ void getAllShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.GET_ALL);
+ Image[] images = template.requestBody(uri, null, Image[].class);
+
+ assertEquals(2, images.length);
+ assertEquals("7541b8be-c62b-46c3-b5a5-5bb5ce43ce01",
images[0].getId());
+ }
+
+ @Test
+ void deleteShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.DELETE);
+ template.requestBodyAndHeader(uri, null, OpenstackConstants.ID,
"8a2ea42d-06b5-42c2-a54d-97105420f2bb");
+ }
+}
diff --git
a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackKeystoneDomainTest.java
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackKeystoneDomainTest.java
new file mode 100644
index 0000000..8d846e4
--- /dev/null
+++
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackKeystoneDomainTest.java
@@ -0,0 +1,95 @@
+/*
+ * 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.openstack.it;
+
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.apache.camel.component.openstack.keystone.KeystoneConstants;
+import org.junit.jupiter.api.Test;
+import org.openstack4j.api.Builders;
+import org.openstack4j.model.identity.v3.Domain;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class OpenstackKeystoneDomainTest extends OpenstackWiremockTestSupport {
+
+ private static final String URI_FORMAT
+ =
"openstack-keystone://%s?username=user&password=secret&project=project&operation=%s&subsystem="
+ + KeystoneConstants.DOMAINS;
+
+ private static final String DOMAIN_NAME = "Domain_CRUD";
+ private static final String DOMAIN_ID = "98c110ae41c249189c9d5c25d8377b65";
+ private static final String DOMAIN_DESCRIPTION = "Domain used for CRUD
tests";
+ private static final String DOMAIN_DESCRIPTION_UPDATED = "An updated
domain used for CRUD tests";
+
+ @Test
+ void createShouldSucceed() {
+ Domain in =
Builders.domain().name(DOMAIN_NAME).description(DOMAIN_DESCRIPTION).enabled(true).build();
+
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.CREATE);
+ Domain out = template.requestBody(uri, in, Domain.class);
+
+ assertNotNull(out);
+ assertEquals(DOMAIN_NAME, out.getName());
+ assertEquals(DOMAIN_ID, out.getId());
+ assertEquals(DOMAIN_DESCRIPTION, out.getDescription());
+ }
+
+ @Test
+ void getShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(), OpenstackConstants.GET);
+ Domain out = template.requestBodyAndHeader(uri, null,
OpenstackConstants.ID, DOMAIN_ID, Domain.class);
+
+ assertNotNull(out);
+ assertEquals(DOMAIN_NAME, out.getName());
+ assertEquals(DOMAIN_ID, out.getId());
+ assertEquals(DOMAIN_DESCRIPTION, out.getDescription());
+ assertFalse(out.isEnabled());
+ }
+
+ @Test
+ void getAllShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.GET_ALL);
+ Domain[] domains = template.requestBody(uri, null, Domain[].class);
+
+ assertEquals(1, domains.length);
+ assertEquals("default", domains[0].getId());
+ assertNotNull(domains[0].getOptions());
+ assertTrue(domains[0].getOptions().isEmpty());
+ }
+
+ @Test
+ void updateShouldSucceed() {
+ Domain in =
Builders.domain().name(DOMAIN_NAME).description(DOMAIN_DESCRIPTION_UPDATED).id(DOMAIN_ID).build();
+
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.UPDATE);
+ Domain out = template.requestBody(uri, in, Domain.class);
+
+ assertNotNull(out);
+ assertEquals(DOMAIN_NAME, out.getName());
+ assertEquals(DOMAIN_ID, out.getId());
+ assertEquals(DOMAIN_DESCRIPTION_UPDATED, out.getDescription());
+ }
+
+ @Test
+ void deleteShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.DELETE);
+ template.requestBodyAndHeader(uri, null, OpenstackConstants.ID,
DOMAIN_ID);
+ }
+}
diff --git
a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackKeystoneGroupTest.java
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackKeystoneGroupTest.java
new file mode 100644
index 0000000..b864a46
--- /dev/null
+++
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackKeystoneGroupTest.java
@@ -0,0 +1,133 @@
+/*
+ * 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.openstack.it;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.apache.camel.component.openstack.keystone.KeystoneConstants;
+import org.junit.jupiter.api.Test;
+import org.openstack4j.api.Builders;
+import org.openstack4j.model.identity.v3.Group;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class OpenstackKeystoneGroupTest extends OpenstackWiremockTestSupport {
+
+ private static final String URI_FORMAT
+ =
"openstack-keystone://%s?username=user&password=secret&project=project&operation=%s&subsystem="
+ + KeystoneConstants.GROUPS;
+
+ private static final String GROUP_NAME = "GROUP_CRUD";
+ private static final String GROUP_ID = "c0d675eac29945ad9dfd08aa1bb75751";
+ private static final String GROUP_DOMAIN_ID = "default";
+ private static final String GROUP_DESCRIPTION = "Group used for CRUD
tests";
+ private static final String GROUP_DESCRIPTION_UPDATED = "An updated group
used for CRUD tests";
+
+ @Test
+ void createShouldSucceed() {
+ Group in =
Builders.group().name(GROUP_NAME).description(GROUP_DESCRIPTION).domainId(GROUP_DOMAIN_ID).build();
+
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.CREATE);
+ Group out = template.requestBody(uri, in, Group.class);
+
+ assertNotNull(out);
+ assertEquals(GROUP_NAME, out.getName());
+ assertEquals(GROUP_DOMAIN_ID, out.getDomainId());
+ assertEquals(GROUP_DESCRIPTION, out.getDescription());
+ }
+
+ @Test
+ void getShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(), OpenstackConstants.GET);
+ Group out = template.requestBodyAndHeader(uri, null,
OpenstackConstants.ID, GROUP_ID, Group.class);
+
+ assertNotNull(out);
+ assertEquals(GROUP_NAME, out.getName());
+ assertEquals(GROUP_ID, out.getId());
+ assertEquals(GROUP_DOMAIN_ID, out.getDomainId());
+ assertEquals(GROUP_DESCRIPTION, out.getDescription());
+ }
+
+ @Test
+ void getAllShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.GET_ALL);
+ Group[] groups = template.requestBody(uri, null, Group[].class);
+
+ assertEquals(5, groups.length);
+
+ assertEquals("7261c982051c4080a69a52117a861d64", groups[0].getId());
+ assertEquals("default", groups[1].getDomainId());
+ assertEquals("Group for CRUD tests", groups[2].getDescription());
+ assertEquals("role_crud_group", groups[3].getName());
+ assertNotNull(groups[4].getLinks());
+ assertTrue(groups[4].getLinks().containsKey("self"));
+ }
+
+ @Test
+ void updateShouldSucceed() {
+ Group in =
Builders.group().id(GROUP_ID).description(GROUP_DESCRIPTION_UPDATED).build();
+
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.UPDATE);
+ Group out = template.requestBody(uri, in, Group.class);
+
+ assertNotNull(out);
+ assertEquals(GROUP_NAME, out.getName());
+ assertEquals(GROUP_ID, out.getId());
+ assertEquals(GROUP_DESCRIPTION_UPDATED, out.getDescription());
+ }
+
+ @Test
+ void deleteShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.DELETE);
+ template.requestBodyAndHeader(uri, null, OpenstackConstants.ID,
GROUP_ID);
+ }
+
+ @Test
+ void addUserToGroupShouldSucceed() {
+ Map<String, Object> headers = new HashMap<>();
+ headers.put(KeystoneConstants.USER_ID,
"d599b83141fc47bc9c25e89267aa27c4");
+ headers.put(KeystoneConstants.GROUP_ID,
"851398fccda34f208e1839ebbc1251d1");
+
+ String uri = String.format(URI_FORMAT, url(),
KeystoneConstants.ADD_USER_TO_GROUP);
+ template.requestBodyAndHeaders(uri, null, headers, Group.class);
+ }
+
+ @Test
+ void checkUserGroupShouldSucceed() {
+ Map<String, Object> headers = new HashMap<>();
+ headers.put(KeystoneConstants.USER_ID,
"d599b83141fc47bc9c25e89267aa27c4");
+ headers.put(KeystoneConstants.GROUP_ID,
"851398fccda34f208e1839ebbc1251d1");
+
+ String uri = String.format(URI_FORMAT, url(),
KeystoneConstants.CHECK_GROUP_USER);
+ boolean userInGroup = template.requestBodyAndHeaders(uri, null,
headers, Boolean.class);
+ assertTrue(userInGroup);
+ }
+
+ @Test
+ void removeUserFromGroupShouldSucceed() {
+ Map<String, Object> headers = new HashMap<>();
+ headers.put(KeystoneConstants.USER_ID,
"d599b83141fc47bc9c25e89267aa27c4");
+ headers.put(KeystoneConstants.GROUP_ID,
"851398fccda34f208e1839ebbc1251d1");
+
+ String uri = String.format(URI_FORMAT, url(),
KeystoneConstants.REMOVE_USER_FROM_GROUP);
+ template.requestBodyAndHeaders(uri, null, headers);
+ }
+}
diff --git
a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackKeystoneProjectTest.java
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackKeystoneProjectTest.java
new file mode 100644
index 0000000..eea327a
--- /dev/null
+++
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackKeystoneProjectTest.java
@@ -0,0 +1,117 @@
+/*
+ * 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.openstack.it;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.apache.camel.component.openstack.keystone.KeystoneConstants;
+import org.junit.jupiter.api.Test;
+import org.openstack4j.api.Builders;
+import org.openstack4j.model.identity.v3.Project;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class OpenstackKeystoneProjectTest extends OpenstackWiremockTestSupport
{
+
+ private static final String URI_FORMAT
+ =
"openstack-keystone://%s?username=user&password=secret&project=project&operation=%s&subsystem="
+ + KeystoneConstants.PROJECTS;
+
+ private static final String PROJECT_NAME = "ProjectX";
+ private static final String PROJECT_ID =
"3337151a1c38496c8bffcb280b19c346";
+ private static final String PROJECT_DOMAIN_ID =
"7a71863c2d1d4444b3e6c2cd36955e1e";
+ private static final String PROJECT_DESCRIPTION = "Project used for CRUD
tests";
+ private static final String PROJECT_DESCRIPTION_UPDATED = "An updated
project used for CRUD tests";
+ private static final String PROJECT_EXTRA_KEY_1 = "extra_key1";
+ private static final String PROJECT_EXTRA_VALUE_1 = "value1";
+ private static final String PROJECT_EXTRA_KEY_2 = "extra_key2";
+ private static final String PROJECT_EXTRA_VALUE_2 = "value2";
+ private static final List<String> TAGS = Arrays.asList("one", "two",
"three");
+
+ @Test
+ void createShouldSucceed() {
+ Project in =
Builders.project().name(PROJECT_NAME).description(PROJECT_DESCRIPTION).domainId(PROJECT_DOMAIN_ID)
+ .setExtra(PROJECT_EXTRA_KEY_1, PROJECT_EXTRA_VALUE_1)
+ .enabled(true).setTags(TAGS).build();
+
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.CREATE);
+ Project out = template.requestBody(uri, in, Project.class);
+
+ assertNotNull(out);
+ assertEquals(PROJECT_NAME, out.getName());
+ assertEquals(PROJECT_ID, out.getId());
+ assertEquals(PROJECT_DOMAIN_ID, out.getDomainId());
+ assertEquals(PROJECT_DESCRIPTION, out.getDescription());
+ assertEquals(PROJECT_EXTRA_VALUE_1, out.getExtra(PROJECT_EXTRA_KEY_1));
+ assertEquals(TAGS, out.getTags());
+ }
+
+ @Test
+ void getShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(), OpenstackConstants.GET);
+ Project out = template.requestBodyAndHeader(uri, null,
OpenstackConstants.ID, PROJECT_ID, Project.class);
+
+ assertNotNull(out);
+ assertEquals(PROJECT_NAME, out.getName());
+ assertEquals(PROJECT_ID, out.getId());
+ assertEquals(PROJECT_DOMAIN_ID, out.getDomainId());
+ assertEquals(PROJECT_DESCRIPTION, out.getDescription());
+ }
+
+ @Test
+ void getAllShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.GET_ALL);
+ Project[] projects = template.requestBody(uri, null, Project[].class);
+
+ assertEquals(3, projects.length);
+ assertEquals("10b40033bbef48f89fe838fef62398f0", projects[0].getId());
+ assertEquals("600905d353a84b20b644d2fe55a21e8a", projects[1].getId());
+ assertEquals("8519dba9f4594f0f87071c87784a8d2c", projects[2].getId());
+ assertNotNull(projects[2].getOptions());
+ assertTrue(projects[2].getOptions().isEmpty());
+ assertNotNull(projects[2].getTags());
+ assertTrue(projects[2].getTags().isEmpty());
+ }
+
+ @Test
+ void updateShouldSucceed() {
+ Project in =
Builders.project().id(PROJECT_ID).description(PROJECT_DESCRIPTION_UPDATED)
+ .setExtra(PROJECT_EXTRA_KEY_2, PROJECT_EXTRA_VALUE_2).build();
+
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.UPDATE);
+ Project out = template.requestBody(uri, in, Project.class);
+
+ assertNotNull(out);
+ assertEquals(PROJECT_ID, out.getId());
+ assertEquals(PROJECT_NAME, out.getName());
+ assertEquals(PROJECT_DOMAIN_ID, out.getDomainId());
+ assertEquals(PROJECT_DESCRIPTION_UPDATED, out.getDescription());
+ assertEquals(PROJECT_EXTRA_VALUE_1, out.getExtra(PROJECT_EXTRA_KEY_1));
+ assertEquals(PROJECT_EXTRA_VALUE_2, out.getExtra(PROJECT_EXTRA_KEY_2));
+ }
+
+ @Test
+ void deleteShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.DELETE);
+ template.requestBodyAndHeader(uri, null, OpenstackConstants.ID,
PROJECT_ID);
+ }
+
+}
diff --git
a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackKeystoneRegionTest.java
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackKeystoneRegionTest.java
new file mode 100644
index 0000000..125e3fa
--- /dev/null
+++
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackKeystoneRegionTest.java
@@ -0,0 +1,103 @@
+/*
+ * 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.openstack.it;
+
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.apache.camel.component.openstack.keystone.KeystoneConstants;
+import org.junit.jupiter.api.Test;
+import org.openstack4j.api.Builders;
+import org.openstack4j.model.identity.v3.Region;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+public class OpenstackKeystoneRegionTest extends OpenstackWiremockTestSupport {
+
+ private static final String URI_FORMAT
+ =
"openstack-keystone://%s?username=user&password=secret&project=project&operation=%s&subsystem="
+ + KeystoneConstants.REGIONS;
+
+ private static final String REGION_ID = "Region_CRUD";
+ private static final String REGION_PARENTREGIONID = "RegionOne";
+ private static final String REGION_DESCRIPTION = "No description
provided.";
+ private static final String REGION_DESCRIPTION_UPDATED = "A updated region
used for CRUD tests.";
+
+ @Test
+ void createShouldSucceed() {
+ Region in
+ =
Builders.region().id(REGION_ID).description(REGION_DESCRIPTION).parentRegionId(REGION_PARENTREGIONID).build();
+
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.CREATE);
+ Region out = template.requestBody(uri, in, Region.class);
+
+ assertNotNull(out);
+ assertEquals(REGION_ID, out.getId());
+ assertEquals(REGION_DESCRIPTION, out.getDescription());
+ assertEquals(REGION_PARENTREGIONID, out.getParentRegionId());
+ }
+
+ @Test
+ void getShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(), OpenstackConstants.GET);
+ Region out = template.requestBodyAndHeader(uri, null,
OpenstackConstants.ID, REGION_ID, Region.class);
+
+ assertNotNull(out);
+ assertEquals(REGION_ID, out.getId());
+ assertEquals(REGION_DESCRIPTION, out.getDescription());
+ assertEquals(REGION_PARENTREGIONID, out.getParentRegionId());
+ }
+
+ @Test
+ void getAllShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.GET_ALL);
+ Region[] regions = template.requestBody(uri, null, Region[].class);
+
+ assertEquals(2, regions.length);
+ assertEquals(REGION_PARENTREGIONID, regions[0].getId());
+ assertEquals(null, regions[0].getParentRegionId());
+ assertEquals(REGION_ID, regions[1].getId());
+ assertEquals(REGION_PARENTREGIONID, regions[1].getParentRegionId());
+ }
+
+ @Test
+ void updateShouldSucceed() {
+ Region in =
Builders.region().id(REGION_ID).description(REGION_DESCRIPTION_UPDATED).build();
+
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.UPDATE);
+ Region out = template.requestBody(uri, in, Region.class);
+
+ assertNotNull(out);
+ assertEquals(REGION_ID, out.getId());
+ assertEquals(REGION_DESCRIPTION_UPDATED, out.getDescription());
+ assertEquals(REGION_PARENTREGIONID, out.getParentRegionId());
+ }
+
+ @Test
+ void deleteShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.DELETE);
+ template.requestBodyAndHeader(uri, null, OpenstackConstants.ID,
REGION_ID);
+ }
+
+ @Test
+ void getUnknownRegionShouldReturnNull() {
+ String uri = String.format(URI_FORMAT, url(), OpenstackConstants.GET);
+ Region out = template.requestBodyAndHeader(uri, null,
OpenstackConstants.ID, "nonExistentRegionId", Region.class);
+
+ assertNull(out);
+ }
+}
diff --git
a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackKeystoneUserTest.java
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackKeystoneUserTest.java
new file mode 100644
index 0000000..5a85ece
--- /dev/null
+++
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackKeystoneUserTest.java
@@ -0,0 +1,98 @@
+/*
+ * 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.openstack.it;
+
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.apache.camel.component.openstack.keystone.KeystoneConstants;
+import org.junit.jupiter.api.Test;
+import org.openstack4j.api.Builders;
+import org.openstack4j.model.identity.v3.User;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class OpenstackKeystoneUserTest extends OpenstackWiremockTestSupport {
+ private static final String URI_FORMAT
+ =
"openstack-keystone://%s?username=user&password=secret&project=project&operation=%s&subsystem="
+ + KeystoneConstants.USERS;
+
+ private static final String USER_NAME = "foobar";
+ private static final String USER_DOMAIN_ID = "default";
+ private static final String USER_EMAIL = "[email protected]";
+ private static final String USER_EMAIL_UPDATED =
"[email protected]";
+ private static final String USER_ID = "29d5aaaa6d3b471e9c101ae470e649a6";
+
+ @Test
+ void createShouldSucceed() {
+ User in =
Builders.user().name(USER_NAME).domainId(USER_DOMAIN_ID).email(USER_EMAIL).enabled(true).build();
+
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.CREATE);
+ User out = template.requestBody(uri, in, User.class);
+
+ assertNotNull(out);
+ assertEquals(USER_NAME, out.getName());
+ assertEquals(USER_DOMAIN_ID, out.getDomainId());
+ assertEquals(USER_EMAIL, out.getEmail());
+ assertTrue(out.isEnabled());
+ assertEquals(USER_ID, out.getId());
+ }
+
+ @Test
+ void getShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(), OpenstackConstants.GET);
+ User out = template.requestBodyAndHeader(uri, null,
OpenstackConstants.ID, USER_ID, User.class);
+
+ assertNotNull(out);
+ assertEquals(USER_NAME, out.getName());
+ assertEquals(USER_DOMAIN_ID, out.getDomainId());
+ assertTrue(out.isEnabled());
+ assertEquals(USER_ID, out.getId());
+ }
+
+ @Test
+ void getAllShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.GET_ALL);
+ User[] users = template.requestBody(uri, null, User[].class);
+
+ assertNotNull(users);
+ assertEquals(6, users.length);
+ assertEquals("glance", users[0].getName());
+ assertEquals("default", users[1].getDomainId());
+ assertNull(users[2].getEmail());
+ assertEquals("7afec08993c24bb09df141e513738030", users[3].getId());
+ }
+
+ @Test
+ void updateShouldSucceed() {
+ User in =
Builders.user().id(USER_ID).email(USER_EMAIL_UPDATED).build();
+
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.UPDATE);
+ User out = template.requestBody(uri, in, User.class);
+
+ assertNotNull(out);
+ assertEquals(USER_ID, out.getId());
+ assertEquals(USER_EMAIL_UPDATED, out.getEmail());
+ }
+
+ @Test
+ void deleteShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.DELETE);
+ template.requestBodyAndHeader(uri, null, OpenstackConstants.ID,
USER_ID);
+ }
+}
diff --git
a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackNeutronNetworkTest.java
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackNeutronNetworkTest.java
new file mode 100644
index 0000000..dd11462
--- /dev/null
+++
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackNeutronNetworkTest.java
@@ -0,0 +1,85 @@
+/*
+ * 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.openstack.it;
+
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.apache.camel.component.openstack.neutron.NeutronConstants;
+import org.junit.jupiter.api.Test;
+import org.openstack4j.api.Builders;
+import org.openstack4j.model.network.Network;
+import org.openstack4j.model.network.NetworkType;
+import org.openstack4j.model.network.State;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class OpenstackNeutronNetworkTest extends OpenstackWiremockTestSupport {
+
+ private static final String URI_FORMAT
+ =
"openstack-neutron://%s?username=user&password=secret&project=project&operation=%s&subsystem="
+ + NeutronConstants.NEUTRON_NETWORK_SUBSYSTEM;
+
+ private static final String NETWORK_NAME = "net1";
+ private static final String NETWORK_ID =
"4e8e5957-649f-477b-9e5b-f1f75b21c03c";
+
+ @Test
+ void createShouldSucceed() {
+ Network in =
Builders.network().name(NETWORK_NAME).isRouterExternal(true).adminStateUp(true).build();
+
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.CREATE);
+ Network out = template.requestBody(uri, in, Network.class);
+
+ assertEquals(NETWORK_NAME, out.getName());
+ assertEquals(State.ACTIVE, out.getStatus());
+ assertTrue(out.isRouterExternal());
+ }
+
+ @Test
+ void getShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(), OpenstackConstants.GET);
+ Network out = template.requestBodyAndHeader(uri, null,
OpenstackConstants.ID, NETWORK_ID, Network.class);
+
+ assertNotNull(out);
+ assertEquals(NETWORK_NAME, out.getName());
+ assertEquals(State.ACTIVE, out.getStatus());
+ assertFalse(out.isRouterExternal());
+ }
+
+ @Test
+ void getAllShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.GET_ALL);
+ Network[] networks = template.requestBody(uri, null, Network[].class);
+
+ assertNotNull(networks);
+ assertEquals(1, networks.length);
+
+ assertEquals(NETWORK_NAME, networks[0].getName());
+ assertNotNull(networks[0].getSubnets());
+ assertEquals(1, networks[0].getSubnets().size());
+ assertEquals("0c4faf33-8c23-4dc9-8bf5-30dd1ab452f9",
networks[0].getSubnets().get(0));
+ assertEquals("73f6f1ac-5e58-4801-88c3-7e12c6ddfb39",
networks[0].getId());
+ assertEquals(NetworkType.VXLAN, networks[0].getNetworkType());
+ }
+
+ @Test
+ void deleteShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.DELETE);
+ template.requestBodyAndHeader(uri, null, OpenstackConstants.ID,
NETWORK_ID);
+ }
+}
diff --git
a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackNeutronPortTest.java
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackNeutronPortTest.java
new file mode 100644
index 0000000..28c6f75
--- /dev/null
+++
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackNeutronPortTest.java
@@ -0,0 +1,65 @@
+/*
+ * 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.openstack.it;
+
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.apache.camel.component.openstack.neutron.NeutronConstants;
+import org.junit.jupiter.api.Test;
+import org.openstack4j.api.Builders;
+import org.openstack4j.model.network.AllowedAddressPair;
+import org.openstack4j.model.network.Port;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+public class OpenstackNeutronPortTest extends OpenstackWiremockTestSupport {
+
+ private static final String URI_FORMAT
+ =
"openstack-neutron://%s?username=user&password=secret&project=project&operation=%s&subsystem="
+ + NeutronConstants.NEUTRON_PORT_SYSTEM;
+
+ private static final String NETWORK_ID =
"a87cc70a-3e15-4acf-8205-9b711a3531b7";
+
+ @Test
+ void createShouldSucceed() {
+ Port in = Builders.port().networkId(NETWORK_ID).build();
+
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.CREATE);
+ Port out = template.requestBody(uri, in, Port.class);
+
+ assertNotNull(out);
+ assertEquals(NETWORK_ID, out.getNetworkId());
+ assertNotNull(out.getAllowedAddressPairs());
+ assertEquals(1, out.getAllowedAddressPairs().size());
+ AllowedAddressPair allowedAddressPair =
out.getAllowedAddressPairs().iterator().next();
+ assertNotNull(allowedAddressPair.getIpAddress());
+ assertNotNull(allowedAddressPair.getMacAddress());
+ }
+
+ @Test
+ void getAllShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.GET_ALL);
+ Port[] ports = template.requestBody(uri, null, Port[].class);
+
+ assertNotNull(ports);
+ assertEquals(2, ports.length);
+ assertEquals(NETWORK_ID, ports[0].getNetworkId());
+ assertEquals("94225baa-9d3f-4b93-bf12-b41e7ce49cdb", ports[0].getId());
+ assertEquals(NETWORK_ID, ports[1].getNetworkId());
+ assertEquals("235b09e0-63c4-47f1-b221-66ba54c21760", ports[1].getId());
+ }
+}
diff --git
a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackNeutronSubnetTest.java
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackNeutronSubnetTest.java
new file mode 100644
index 0000000..59ab2af
--- /dev/null
+++
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackNeutronSubnetTest.java
@@ -0,0 +1,51 @@
+/*
+ * 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.openstack.it;
+
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.apache.camel.component.openstack.neutron.NeutronConstants;
+import org.junit.jupiter.api.Test;
+import org.openstack4j.model.network.Ipv6AddressMode;
+import org.openstack4j.model.network.Ipv6RaMode;
+import org.openstack4j.model.network.Subnet;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class OpenstackNeutronSubnetTest extends OpenstackWiremockTestSupport {
+
+ private static final String URI_FORMAT
+ =
"openstack-neutron://%s?username=user&password=secret&project=project&operation=%s&subsystem="
+ + NeutronConstants.NEUTRON_SUBNETS_SYSTEM;
+
+ private static final String SUBNET_NAME = "sub1";
+ private static final String SUBNET_ID =
"3b80198d-4f7b-4f77-9ef5-774d54e17126";
+
+ @Test
+ void getShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(), OpenstackConstants.GET);
+ Subnet out = template.requestBodyAndHeader(uri, null,
OpenstackConstants.ID, SUBNET_ID, Subnet.class);
+
+ assertNotNull(out);
+ assertEquals(SUBNET_NAME, out.getName());
+ assertEquals(Ipv6AddressMode.DHCPV6_STATEFUL,
out.getIpv6AddressMode());
+ assertEquals(Ipv6RaMode.DHCPV6_STATEFUL, out.getIpv6RaMode());
+ assertNotNull(out.getDnsNames());
+ assertTrue(out.getDnsNames().isEmpty());
+ }
+}
diff --git
a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackNovaFlavorTest.java
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackNovaFlavorTest.java
new file mode 100644
index 0000000..0b1cc0e
--- /dev/null
+++
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackNovaFlavorTest.java
@@ -0,0 +1,84 @@
+/*
+ * 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.openstack.it;
+
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.apache.camel.component.openstack.nova.NovaConstants;
+import org.junit.jupiter.api.Test;
+import org.openstack4j.api.Builders;
+import org.openstack4j.model.compute.Flavor;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class OpenstackNovaFlavorTest extends OpenstackWiremockTestSupport {
+
+ private static final String URI_FORMAT
+ =
"openstack-nova://%s?username=user&password=secret&project=project&operation=%s&subsystem="
+ + NovaConstants.NOVA_SUBSYSTEM_FLAVORS;
+
+ private static final String FLAVOR_ID = "1";
+ private static final String FLAVOR_NAME = "m1.tiny";
+
+ @Test
+ void createShouldSucceed() {
+ Flavor in =
Builders.flavor().name("safe_to_delete_flavor").vcpus(1).disk(2).isPublic(true).rxtxFactor(2.0f)
+ .ephemeral(1).ram(128).id("delete_1").swap(1).build();
+
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.CREATE);
+ Flavor out = template.requestBody(uri, in, Flavor.class);
+
+ assertNotNull(out);
+ assertEquals(1, out.getVcpus());
+ assertEquals(2, out.getDisk());
+ assertEquals(FLAVOR_NAME, out.getName());
+ assertTrue(out.isPublic());
+ assertEquals(2.0f, out.getRxtxFactor());
+ assertEquals(1, out.getEphemeral());
+ assertEquals(128, out.getRam());
+ assertEquals(FLAVOR_ID, out.getId());
+ assertEquals(1, out.getSwap());
+ }
+
+ @Test
+ void getShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(), OpenstackConstants.GET);
+ Flavor out = template.requestBodyAndHeader(uri, null,
OpenstackConstants.ID, FLAVOR_ID, Flavor.class);
+
+ assertNotNull(out);
+ assertEquals(1, out.getDisk());
+ assertEquals(FLAVOR_NAME, out.getName());
+ assertEquals(512, out.getRam());
+ assertTrue(out.isPublic());
+ assertEquals(0, out.getEphemeral());
+ assertFalse(out.isDisabled());
+ assertEquals(2.0f, out.getRxtxFactor());
+ assertEquals(1, out.getVcpus());
+ }
+
+ @Test
+ void getAllShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.GET_ALL);
+ Flavor[] flavors = template.requestBody(uri, null, Flavor[].class);
+
+ assertNotNull(flavors);
+ assertEquals(2, flavors.length);
+ }
+
+}
diff --git
a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackNovaServerTest.java
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackNovaServerTest.java
new file mode 100644
index 0000000..54848fc
--- /dev/null
+++
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackNovaServerTest.java
@@ -0,0 +1,98 @@
+/*
+ * 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.openstack.it;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.camel.CamelExecutionException;
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.apache.camel.component.openstack.nova.NovaConstants;
+import org.junit.jupiter.api.Test;
+import org.openstack4j.api.Builders;
+import org.openstack4j.api.exceptions.ServerResponseException;
+import org.openstack4j.model.compute.Server;
+import org.openstack4j.model.compute.Server.Status;
+import org.openstack4j.model.compute.ServerCreate;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
+public class OpenstackNovaServerTest extends OpenstackWiremockTestSupport {
+
+ private static final String URI_FORMAT
+ =
"openstack-nova://%s?username=user&password=secret&project=project&operation=%s&subsystem="
+ + NovaConstants.NOVA_SUBSYSTEM_SERVERS;
+
+ private static final String SERVER_NAME = "server-test-1";
+ private static final String SERVER_ID =
"e565cbdb-8e74-4044-ba6e-0155500b2c46";
+ private static final String SERVER_WRONG_ID =
"05184ba3-00ba-4fbc-b7a2-03b62b884931";
+ private static final String SERVER_SNAPSHOT_NAME = "server-snapshot";
+ private static final String SERVER_SNAPSHOT_ID =
"72f759b3-2576-4bf0-9ac9-7cb4a5b9d541";
+
+ @Test
+ void createShouldSucceed() {
+ ServerCreate in = Builders.server().name(SERVER_NAME).build();
+
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.CREATE);
+ Server out = template.requestBody(uri, in, Server.class);
+
+ assertNotNull(out);
+ assertEquals(SERVER_NAME, out.getName());
+ }
+
+ @Test
+ void createSnapshotShouldSucceed() {
+ Map<String, Object> headers = new HashMap<String, Object>();
+ headers.put(OpenstackConstants.ID, SERVER_ID);
+ headers.put(OpenstackConstants.NAME, SERVER_SNAPSHOT_NAME);
+
+ String uri = String.format(URI_FORMAT, url(),
NovaConstants.CREATE_SNAPSHOT);
+ String out = template.requestBodyAndHeaders(uri, null, headers,
String.class);
+
+ assertEquals(SERVER_SNAPSHOT_ID, out);
+ }
+
+ @Test
+ void getWrongIdShouldThrow() {
+ String uri = String.format(URI_FORMAT, url(), OpenstackConstants.GET);
+
+ try {
+ template.requestBodyAndHeader(uri, null, OpenstackConstants.ID,
SERVER_WRONG_ID, Server.class);
+ fail("Getting nova server with wrong id should throw");
+ } catch (Exception ex) {
+ assertTrue(ex instanceof CamelExecutionException);
+ assertTrue(((CamelExecutionException) ex).getCause() instanceof
ServerResponseException);
+ }
+ }
+
+ @Test
+ void getAllShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.GET_ALL);
+ Server[] servers = template.requestBody(uri, null, Server[].class);
+
+ assertNotNull(servers);
+ assertEquals(1, servers.length);
+ assertEquals(1,
servers[0].getAddresses().getAddresses("private").size());
+ assertEquals("192.168.0.3",
servers[0].getAddresses().getAddresses("private").get(0).getAddr());
+ assertEquals(Status.ACTIVE, servers[0].getStatus());
+ assertEquals("new-server-test", servers[0].getName());
+ }
+
+}
diff --git
a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackSwiftContainerTest.java
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackSwiftContainerTest.java
new file mode 100644
index 0000000..20c7d4b
--- /dev/null
+++
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackSwiftContainerTest.java
@@ -0,0 +1,61 @@
+/*
+ * 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.openstack.it;
+
+import java.util.Map;
+
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.apache.camel.component.openstack.swift.SwiftConstants;
+import org.junit.jupiter.api.Test;
+import org.openstack4j.model.storage.object.SwiftContainer;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+public class OpenstackSwiftContainerTest extends OpenstackWiremockTestSupport {
+
+ private static final String URI_FORMAT
+ =
"openstack-swift://%s?username=user&password=secret&project=project&operation=%s&subsystem="
+ + SwiftConstants.SWIFT_SUBSYSTEM_CONTAINERS;
+
+ private static final String CONTAINER_NAME = "myContainer";
+ private static final String NAME_BOOK = "Book";
+ private static final String NAME_YEAR = "Year";
+
+ @Test
+ void getAllShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
OpenstackConstants.GET_ALL);
+ SwiftContainer[] containers = template.requestBody(uri, null,
SwiftContainer[].class);
+
+ assertNotNull(containers);
+ assertEquals(2, containers.length);
+ assertEquals(100, containers[0].getTotalSize());
+ assertEquals("Test", containers[0].getName());
+ assertEquals("marktwain", containers[1].getName());
+ }
+
+ @Test
+ void getMetadataShouldSucceed() {
+ String uri = String.format(URI_FORMAT, url(),
SwiftConstants.GET_METADATA);
+ Map<?, ?> metadata = template.requestBodyAndHeader(uri, null,
SwiftConstants.CONTAINER_NAME, CONTAINER_NAME, Map.class);
+
+ assertNotNull(metadata);
+ assertEquals("2000", metadata.get(NAME_YEAR));
+ assertEquals("TestBook", metadata.get(NAME_BOOK));
+ }
+
+}
diff --git
a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackSwiftObjectTest.java
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackSwiftObjectTest.java
new file mode 100644
index 0000000..5a44271
--- /dev/null
+++
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackSwiftObjectTest.java
@@ -0,0 +1,54 @@
+/*
+ * 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.openstack.it;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.camel.component.openstack.common.OpenstackConstants;
+import org.apache.camel.component.openstack.swift.SwiftConstants;
+import org.junit.jupiter.api.Test;
+import org.openstack4j.model.storage.object.SwiftObject;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class OpenstackSwiftObjectTest extends OpenstackWiremockTestSupport {
+
+ private static final String URI_FORMAT
+ =
"openstack-swift://%s?username=user&password=secret&project=project&operation=%s&subsystem="
+ + SwiftConstants.SWIFT_SUBSYSTEM_OBJECTS;
+
+ private static final String OBJECT_CONTAINER_NAME = "test-container";
+ private static final String OBJECT_NAME = "test-file";
+
+ @Test
+ void getShouldSucceed() {
+ Map<String, Object> headers = new HashMap<>();
+ headers.put(SwiftConstants.CONTAINER_NAME, OBJECT_CONTAINER_NAME);
+ headers.put(SwiftConstants.OBJECT_NAME, OBJECT_NAME);
+
+ String uri = String.format(URI_FORMAT, url(), OpenstackConstants.GET);
+ SwiftObject swiftObject = template.requestBodyAndHeaders(uri, null,
headers, SwiftObject.class);
+
+ assertEquals(OBJECT_CONTAINER_NAME, swiftObject.getContainerName());
+ assertEquals(OBJECT_NAME, swiftObject.getName());
+ assertEquals(15, swiftObject.getSizeInBytes());
+ assertEquals("application/json", swiftObject.getMimeType());
+ assertEquals("12345678901234567890", swiftObject.getETag());
+ }
+
+}
diff --git
a/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackWiremockTestSupport.java
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackWiremockTestSupport.java
new file mode 100644
index 0000000..6bf0cd3
--- /dev/null
+++
b/components/camel-openstack/src/test/java/org/apache/camel/component/openstack/it/OpenstackWiremockTestSupport.java
@@ -0,0 +1,52 @@
+/*
+ * 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.openstack.it;
+
+import com.github.tomakehurst.wiremock.WireMockServer;
+import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
+import
com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+
+import static
com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;
+
+public class OpenstackWiremockTestSupport extends CamelTestSupport {
+
+ private static WireMockServer server;
+
+ @BeforeAll
+ public static void startServer() {
+ WireMockConfiguration configuration = options().dynamicPort();
+ configuration.extensions(new ResponseTemplateTransformer(false));
+
+ server = new WireMockServer(configuration);
+ server.start();
+ }
+
+ @AfterAll
+ public static void stopServer() {
+ if (server != null) {
+ server.stop();
+ }
+ }
+
+ protected static String url() {
+ return server.baseUrl();
+ }
+
+}
diff --git
a/components/camel-openstack/src/test/resources/mappings/cinder/snapshot/volume_snapshots.json
b/components/camel-openstack/src/test/resources/mappings/cinder/snapshot/volume_snapshots.json
new file mode 100644
index 0000000..a63c10f
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/cinder/snapshot/volume_snapshots.json
@@ -0,0 +1,18 @@
+{
+ "id" : "abd83ce9-92e5-41dd-8bad-b5ce5408c775",
+ "name" : "volume_snapshots.json",
+ "request" : {
+ "url" : "/v2/123ac695d4db400a9001b91bb3b8aa46/snapshots",
+ "method" : "GET"
+ },
+ "response" : {
+ "status" : 200,
+ "body" :
"{\"snapshots\":[{\"status\":\"available\",\"display_name\":\"snap-vol-test-1\",\"created_at\":\"2015-04-23T11:32:28.364877\",\"display_description\":\"\",\"volume_id\":\"b0e394e6-bb10-4bfe-960d-edf72100c810\",\"metadata\":{},\"id\":\"a06b0531-c14b-4a7b-8749-de1378dd1007\",\"size\":1},{\"status\":\"available\",\"display_name\":\"snap-vol-test-2\",\"created_at\":\"2015-04-23T11:32:14.620321\",\"display_description\":\"\",\"volume_id\":\"7f47ab73-303c-4a19-b311-6123bb115775\",
[...]
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ }
+ },
+ "uuid" : "abd83ce9-92e5-41dd-8bad-b5ce5408c775",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/cinder/volume/createVolume_multiattach.json
b/components/camel-openstack/src/test/resources/mappings/cinder/volume/createVolume_multiattach.json
new file mode 100644
index 0000000..49e8cef
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/cinder/volume/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/components/camel-openstack/src/test/resources/mappings/cinder/volume/volume.json
b/components/camel-openstack/src/test/resources/mappings/cinder/volume/volume.json
new file mode 100644
index 0000000..8b07cbb
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/cinder/volume/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/components/camel-openstack/src/test/resources/mappings/cinder/volume/volume_delete.json
b/components/camel-openstack/src/test/resources/mappings/cinder/volume/volume_delete.json
new file mode 100644
index 0000000..bca3c9a
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/cinder/volume/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/components/camel-openstack/src/test/resources/mappings/cinder/volume/volume_types.json
b/components/camel-openstack/src/test/resources/mappings/cinder/volume/volume_types.json
new file mode 100644
index 0000000..44b6b13
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/cinder/volume/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/components/camel-openstack/src/test/resources/mappings/cinder/volume/volume_update.json
b/components/camel-openstack/src/test/resources/mappings/cinder/volume/volume_update.json
new file mode 100644
index 0000000..4f7b7ce
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/cinder/volume/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/components/camel-openstack/src/test/resources/mappings/cinder/volume/volumes.json
b/components/camel-openstack/src/test/resources/mappings/cinder/volume/volumes.json
new file mode 100644
index 0000000..9cf4df6
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/cinder/volume/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/components/camel-openstack/src/test/resources/mappings/glance/image.json
b/components/camel-openstack/src/test/resources/mappings/glance/image.json
new file mode 100644
index 0000000..26b99b2
--- /dev/null
+++ b/components/camel-openstack/src/test/resources/mappings/glance/image.json
@@ -0,0 +1,18 @@
+{
+ "id" : "82d0d9f5-c8fa-4256-b3dd-a606c176f0b4",
+ "name" : "image.json",
+ "request" : {
+ "url" : "/v1/images/8a2ea42d-06b5-42c2-a54d-97105420f2bb",
+ "method" : "HEAD"
+ },
+ "response" : {
+ "status" : 200,
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8",
+ "X-Image-Meta-Id" : "8a2ea42d-06b5-42c2-a54d-97105420f2bb"
+ }
+ },
+ "uuid" : "82d0d9f5-c8fa-4256-b3dd-a606c176f0b4",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/glance/image_delete.json
b/components/camel-openstack/src/test/resources/mappings/glance/image_delete.json
new file mode 100644
index 0000000..e4c3788
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/glance/image_delete.json
@@ -0,0 +1,14 @@
+{
+ "id" : "badc456b-f0b4-4542-a30f-1578e56dad95",
+ "name" : "image_delete.json",
+ "request" : {
+ "url" :
"/v2/123ac695d4db400a9001b91bb3b8aa46/images/8a2ea42d-06b5-42c2-a54d-97105420f2bb",
+ "method" : "DELETE"
+ },
+ "response" : {
+ "status" : 200
+ },
+ "uuid" : "badc456b-f0b4-4542-a30f-1578e56dad95",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/glance/image_upload.json
b/components/camel-openstack/src/test/resources/mappings/glance/image_upload.json
new file mode 100644
index 0000000..af0a6ed
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/glance/image_upload.json
@@ -0,0 +1,18 @@
+{
+ "id" : "05e9228c-af70-4878-83fa-093113eaa53b",
+ "name" : "image_upload.json",
+ "request" : {
+ "url" : "/v1/images/4b434528-032b-4467-946c-b5880ce15c06",
+ "method" : "PUT"
+ },
+ "response" : {
+ "status" : 200,
+ "body" :
"{\"image\":{\"status\":\"active\",\"name\":\"amphora-x64-haproxy\",\"tags\":[],\"container_format\":\"bare\",\"created_at\":\"2016-08-09T21:36:25Z\",\"size\":566600704,\"disk_format\":\"qcow2\",\"updated_at\":\"2016-08-09T21:36:29Z\",\"self\":\"\/v2\/images\/8a2ea42d-06b5-42c2-a54d-97105420f2bb\",\"min_disk\":0,\"protected\":false,\"id\":\"4b434528-032b-4467-946c-b5880ce15c06\",\"file\":\"\/v1\/images\/4b434528-032b-4467-946c-b5880ce15c06\/file\",\"checksum\":\"896e5473caaa
[...]
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ }
+ },
+ "uuid" : "05e9228c-af70-4878-83fa-093113eaa53b",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/glance/images.json
b/components/camel-openstack/src/test/resources/mappings/glance/images.json
new file mode 100644
index 0000000..1898103
--- /dev/null
+++ b/components/camel-openstack/src/test/resources/mappings/glance/images.json
@@ -0,0 +1,18 @@
+{
+ "id" : "f0fd049a-9325-4a60-a0fe-9987f7e791d1",
+ "name" : "images.json",
+ "request" : {
+ "url" : "/v1/images",
+ "method" : "POST"
+ },
+ "response" : {
+ "status" : 200,
+ "body" :
"{\"image\":{\"status\":\"active\",\"name\":\"amphora-x64-haproxy\",\"tags\":[],\"container_format\":\"bare\",\"created_at\":\"2016-08-09T21:36:25Z\",\"size\":566600704,\"disk_format\":\"qcow2\",\"updated_at\":\"2016-08-09T21:36:29Z\",\"self\":\"\/v2\/images\/8a2ea42d-06b5-42c2-a54d-97105420f2bb\",\"min_disk\":0,\"protected\":false,\"id\":\"8a2ea42d-06b5-42c2-a54d-97105420f2bb\",\"file\":\"\/v1\/images\/8a2ea42d-06b5-42c2-a54d-97105420f2bb\/file\",\"checksum\":\"896e5473caaa
[...]
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ }
+ },
+ "uuid" : "f0fd049a-9325-4a60-a0fe-9987f7e791d1",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/glance/images_detail.json
b/components/camel-openstack/src/test/resources/mappings/glance/images_detail.json
new file mode 100644
index 0000000..257a10b
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/glance/images_detail.json
@@ -0,0 +1,18 @@
+{
+ "id" : "3ca2b6da-cfbb-463a-9205-7843cbbdf087",
+ "name" : "images_detail.json",
+ "request" : {
+ "url" : "/v1/images/detail",
+ "method" : "GET"
+ },
+ "response" : {
+ "status" : 200,
+ "body" :
"{\"images\":[{\"status\":\"active\",\"name\":\"Fedora-x86_64-20-20140407-sda\",\"tags\":[\"testTag\"],\"container_format\":\"bare\",\"created_at\":\"2016-08-09T21:32:02Z\",\"size\":210829312,\"disk_format\":\"qcow2\",\"updated_at\":\"2016-08-15T20:28:15Z\",\"visibility\":\"public\",\"self\":\"\/v2\/images\/7541b8be-c62b-46c3-b5a5-5bb5ce43ce01\",\"min_disk\":0,\"protected\":false,\"id\":\"7541b8be-c62b-46c3-b5a5-5bb5ce43ce01\",\"file\":\"\/v2\/images\/7541b8be-c62b-46c3-b5a5
[...]
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ }
+ },
+ "uuid" : "3ca2b6da-cfbb-463a-9205-7843cbbdf087",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/authv3_project.json
b/components/camel-openstack/src/test/resources/mappings/keystone/authv3_project.json
new file mode 100644
index 0000000..369d708
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/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/components/camel-openstack/src/test/resources/mappings/keystone/domains/domains_create_response.json
b/components/camel-openstack/src/test/resources/mappings/keystone/domains/domains_create_response.json
new file mode 100644
index 0000000..7e3c1cc
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/domains/domains_create_response.json
@@ -0,0 +1,18 @@
+{
+ "id" : "4adf6297-55fa-472b-8e08-b9060f6440b2",
+ "name" : "domains_create_response.json",
+ "request" : {
+ "url" : "/v3/domains",
+ "method" : "POST"
+ },
+ "response" : {
+ "status" : 201,
+ "body" :
"{\"domain\":{\"links\":{\"self\":\"http:\/\/127.0.0.1:5000\/v3\/domains\/98c110ae41c249189c9d5c25d8377b65\"},\"enabled\":true,\"description\":\"Domain
used for CRUD
tests\",\"name\":\"Domain_CRUD\",\"id\":\"98c110ae41c249189c9d5c25d8377b65\"}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ }
+ },
+ "uuid" : "4adf6297-55fa-472b-8e08-b9060f6440b2",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/domains/domains_delete.json
b/components/camel-openstack/src/test/resources/mappings/keystone/domains/domains_delete.json
new file mode 100644
index 0000000..17d0d84
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/domains/domains_delete.json
@@ -0,0 +1,20 @@
+{
+ "id" : "92c0d2c0-e157-44b6-ba35-5b0c40b415d9",
+ "name" : "domains_delete.json",
+ "request" : {
+ "url" : "/v3/domains/98c110ae41c249189c9d5c25d8377b65",
+ "method" : "DELETE"
+ },
+ "response" : {
+ "status" : 204,
+ "headers" : {
+ "Date": "Wed, 16 Mar 2016 15:01:58 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-aaaf3dea-0c0f-40ef-827b-141be2756eec"
+ }
+ },
+ "uuid" : "92c0d2c0-e157-44b6-ba35-5b0c40b415d9",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/domains/domains_get_byId.json
b/components/camel-openstack/src/test/resources/mappings/keystone/domains/domains_get_byId.json
new file mode 100644
index 0000000..a2e6e96
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/domains/domains_get_byId.json
@@ -0,0 +1,19 @@
+{
+ "id" : "2cddaa4b-0547-446b-ba0a-e03a1aaa47c5",
+ "name" : "domains_get_byId.json",
+ "request" : {
+ "url" : "/v3/domains/98c110ae41c249189c9d5c25d8377b65",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" :
"{\"domain\":{\"links\":{\"self\":\"http:\/\/devstack.openstack.stack:5000\/v3\/domains\/98c110ae41c249189c9d5c25d8377b65\"},\"enabled\":false,\"description\":\"Domain
used for CRUD
tests\",\"name\":\"Domain_CRUD\",\"id\":\"98c110ae41c249189c9d5c25d8377b65\"}}",
+ "headers" : {
+ "Content-Type" : "application/json",
+ "x-openstack-request-id": "req-3fd97a17-e56c-49b0-9246-c721afce0055"
+ },
+ "status" : 200
+ },
+ "uuid" : "2cddaa4b-0547-446b-ba0a-e03a1aaa47c5",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/domains/domains_update_response.json
b/components/camel-openstack/src/test/resources/mappings/keystone/domains/domains_update_response.json
new file mode 100644
index 0000000..588b176
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/domains/domains_update_response.json
@@ -0,0 +1,18 @@
+{
+ "id" : "b09c0fc6-26bd-4152-877d-4a2c61478759",
+ "name" : "domains_update_response.json",
+ "request" : {
+ "url" : "/v3/domains/98c110ae41c249189c9d5c25d8377b65",
+ "method" : "PATCH"
+ },
+ "response" : {
+ "body":
"{\"domain\":{\"links\":{\"self\":\"http:\/\/127.0.0.1:5000\/v3\/domains\/98c110ae41c249189c9d5c25d8377b65\"},\"enabled\":true,\"description\":\"An
updated domain used for CRUD
tests\",\"name\":\"Domain_CRUD\",\"id\":\"98c110ae41c249189c9d5c25d8377b65\"}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 200
+ },
+ "uuid" : "b09c0fc6-26bd-4152-877d-4a2c61478759",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/domains/domains_with_options.json
b/components/camel-openstack/src/test/resources/mappings/keystone/domains/domains_with_options.json
new file mode 100644
index 0000000..63bfe84
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/domains/domains_with_options.json
@@ -0,0 +1,18 @@
+{
+ "id" : "38c152b0-ebd7-48e9-b3a9-5866f0f5ef86",
+ "name" : "domains_with_options.json",
+ "request" : {
+ "url" : "/v3/domains",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" : "{\"domains\":[{\"description\":\"The default
domain\",\"links\":{\"self\":\"http:\/\/127.0.0.1:5000\/v3\/domains\/default\"},\"tags\":[],\"enabled\":true,\"options\":{},\"id\":\"default\",\"name\":\"Default\"}],\"links\":{\"self\":\"http:\/\/127.0.0.1:5000\/v3\/domains?limit=500\",\"previous\":null,\"next\":null}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 200
+ },
+ "uuid" : "38c152b0-ebd7-48e9-b3a9-5866f0f5ef86",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_add_user.json
b/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_add_user.json
new file mode 100644
index 0000000..1686c1a
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_add_user.json
@@ -0,0 +1,20 @@
+{
+ "id" : "5322bec6-a2fd-4152-98d2-810e4b1167c0",
+ "name" : "groups_add_user.json",
+ "request" : {
+ "url" :
"/v3/groups/851398fccda34f208e1839ebbc1251d1/users/d599b83141fc47bc9c25e89267aa27c4",
+ "method" : "PUT"
+ },
+ "response" : {
+ "headers" : {
+ "Date": "Wed, 17 Feb 2016 18:17:43 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-d1524fa5-4265-4ae8-bad9-d705b9766835"
+ },
+ "status" : 204
+ },
+ "uuid" : "5322bec6-a2fd-4152-98d2-810e4b1167c0",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_check_user.json
b/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_check_user.json
new file mode 100644
index 0000000..da57ea6
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_check_user.json
@@ -0,0 +1,20 @@
+{
+ "id" : "9c26c4ce-90b9-44da-9ebe-d2c1218764f6",
+ "name" : "groups_check_user.json",
+ "request" : {
+ "url" :
"/v3/groups/851398fccda34f208e1839ebbc1251d1/users/d599b83141fc47bc9c25e89267aa27c4",
+ "method" : "HEAD"
+ },
+ "response" : {
+ "headers" : {
+ "Date": "Wed, 17 Feb 2016 18:17:43 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-76920b81-66dd-4b88-92d6-2ef9168b9397"
+ },
+ "status" : 204
+ },
+ "uuid" : "9c26c4ce-90b9-44da-9ebe-d2c1218764f6",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_create_response.json
b/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_create_response.json
new file mode 100644
index 0000000..297ae75
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_create_response.json
@@ -0,0 +1,18 @@
+{
+ "id" : "1a86d6a5-736a-4eba-b1ab-a39625f92385",
+ "name" : "groups_create_response.json",
+ "request" : {
+ "url" : "/v3/groups",
+ "method" : "POST"
+ },
+ "response" : {
+ "body" : "{\"group\":{\"domain_id\":\"default\",\"description\":\"Group
used for CRUD
tests\",\"id\":\"c0d675eac29945ad9dfd08aa1bb75751\",\"links\":{\"self\":\"http:\/\/127.0.0.1:5000\/v3\/groups\/c0d675eac29945ad9dfd08aa1bb75751\"},\"name\":\"GROUP_CRUD\"}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 201
+ },
+ "uuid" : "1a86d6a5-736a-4eba-b1ab-a39625f92385",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_delete.json
b/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_delete.json
new file mode 100644
index 0000000..e0ed763
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_delete.json
@@ -0,0 +1,20 @@
+{
+ "id" : "ea1f6a98-86b1-44e0-aecc-9c3b2e15cc9d",
+ "name" : "regions_delete.json",
+ "request" : {
+ "url" : "/v3/groups/c0d675eac29945ad9dfd08aa1bb75751",
+ "method" : "DELETE"
+ },
+ "response" : {
+ "status" : 204,
+ "headers" : {
+ "Date": "Wed, 16 Mar 2016 15:01:58 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-bf13fc70-8a3d-41ff-881a-880bc8a59f4d"
+ }
+ },
+ "uuid" : "ea1f6a98-86b1-44e0-aecc-9c3b2e15cc9d",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_get_byId.json
b/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_get_byId.json
new file mode 100644
index 0000000..8599b2d
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_get_byId.json
@@ -0,0 +1,18 @@
+{
+ "id" : "4e5d9c78-a7c2-41d4-ae93-bfeb3991c272",
+ "name" : "groups_get_byId.json",
+ "request" : {
+ "url" : "/v3/groups/c0d675eac29945ad9dfd08aa1bb75751",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" : "{\"group\":{\"domain_id\":\"default\",\"description\":\"Group
used for CRUD
tests\",\"id\":\"c0d675eac29945ad9dfd08aa1bb75751\",\"links\":{\"self\":\"http:\/\/127.0.0.1:5000\/v3\/groups\/c0d675eac29945ad9dfd08aa1bb75751\"},\"name\":\"GROUP_CRUD\"}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 200
+ },
+ "uuid" : "4e5d9c78-a7c2-41d4-ae93-bfeb3991c272",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_list.json
b/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_list.json
new file mode 100644
index 0000000..d4c0df8
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_list.json
@@ -0,0 +1,22 @@
+{
+ "id" : "123de0b3-ea3f-4eb9-a7f0-aaaaaced130e",
+ "name" : "groups_list.json",
+ "request" : {
+ "url" : "/v3/groups",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" :
"{\"links\":{\"self\":\"http:\/\/devstack.openstack.stack:5000\/v3\/groups\",\"previous\":null,\"next\":null},\"groups\":[{\"domain_id\":\"default\",\"description\":\"openstack
admin
group\",\"id\":\"7261c982051c4080a69a52117a861d64\",\"links\":{\"self\":\"http:\/\/devstack.openstack.stack:5000\/v3\/groups\/7261c982051c4080a69a52117a861d64\"},\"name\":\"admins\"},{\"domain_id\":\"default\",\"description\":\"non-admin
group\",\"id\":\"8030dabf0cb843509602f0b3fa49adc2\",\"link [...]
+ "headers" : {
+ "Content-Type": "application/json",
+ "Date": "Wed, 16 Mar 2016 15:01:58 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-afc2a71a-c0da-4d4b-8be9-93669eac9ece"
+ },
+ "status" : 200
+ },
+ "uuid" : "123de0b3-ea3f-4eb9-a7f0-aaaaaced130e",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_remove_user.json
b/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_remove_user.json
new file mode 100644
index 0000000..e29a6ae
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_remove_user.json
@@ -0,0 +1,20 @@
+{
+ "id" : "62c32d80-aa7c-44c4-8eca-d6514f7cd53d",
+ "name" : "groups_remove_user.json",
+ "request" : {
+ "url" :
"/v3/groups/851398fccda34f208e1839ebbc1251d1/users/d599b83141fc47bc9c25e89267aa27c4",
+ "method" : "DELETE"
+ },
+ "response" : {
+ "headers" : {
+ "Date": "Wed, 17 Feb 2016 18:17:43 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-ba2c6bde-a6da-40ba-9ac2-1980b623344b"
+ },
+ "status" : 204
+ },
+ "uuid" : "62c32d80-aa7c-44c4-8eca-d6514f7cd53d",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_update_response.json
b/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_update_response.json
new file mode 100644
index 0000000..2e85031
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/groups/groups_update_response.json
@@ -0,0 +1,18 @@
+{
+ "id" : "7943ac36-c063-4849-a621-7fd7ddd6b072",
+ "name" : "groups_update_response.json",
+ "request" : {
+ "url" : "/v3/groups/c0d675eac29945ad9dfd08aa1bb75751",
+ "method" : "PATCH"
+ },
+ "response" : {
+ "body": "{\"group\":{\"domain_id\":\"default\",\"description\":\"An
updated group used for CRUD
tests\",\"id\":\"c0d675eac29945ad9dfd08aa1bb75751\",\"links\":{\"self\":\"http:\/\/127.0.0.1:5000\/v3\/groups\/c0d675eac29945ad9dfd08aa1bb75751\"},\"name\":\"GROUP_CRUD\"}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 200
+ },
+ "uuid" : "7943ac36-c063-4849-a621-7fd7ddd6b072",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/projects/projects_create_response.json
b/components/camel-openstack/src/test/resources/mappings/keystone/projects/projects_create_response.json
new file mode 100644
index 0000000..4d4588a
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/projects/projects_create_response.json
@@ -0,0 +1,18 @@
+{
+ "id" : "a41972c3-5f86-4d0e-837b-e3bfdb62062b",
+ "name" : "projects_create_response.json",
+ "request" : {
+ "url" : "/v3/projects",
+ "method" : "POST"
+ },
+ "response" : {
+ "body" : "{\"project\":{\"is_domain\":false,\"description\":\"Project used
for CRUD
tests\",\"links\":{\"self\":\"http:\/\/127.0.0.1:5000\/v3\/projects\/3337151a1c38496c8bffcb280b19c346\"},\"enabled\":true,\"id\":\"3337151a1c38496c8bffcb280b19c346\",\"parent_id\":null,\"domain_id\":\"7a71863c2d1d4444b3e6c2cd36955e1e\",\"name\":\"ProjectX\",\"extra_key1\":\"value1\",\"tags\":[\"one\",\"two\",\"three\"]}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 201
+ },
+ "uuid" : "a41972c3-5f86-4d0e-837b-e3bfdb62062b",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/projects/projects_delete.json
b/components/camel-openstack/src/test/resources/mappings/keystone/projects/projects_delete.json
new file mode 100644
index 0000000..e199189
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/projects/projects_delete.json
@@ -0,0 +1,20 @@
+{
+ "id" : "e2e8dab4-68d1-4fe8-bd73-78a7b5e5374b",
+ "name" : "projects_delete.json",
+ "request" : {
+ "url" : "/v3/projects/3337151a1c38496c8bffcb280b19c346",
+ "method" : "DELETE"
+ },
+ "response" : {
+ "status" : 204,
+ "headers" : {
+ "Date": "Wed, 16 Mar 2016 15:01:58 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-d428e41d-104e-4d70-ba47-0878e914b200"
+ }
+ },
+ "uuid" : "e2e8dab4-68d1-4fe8-bd73-78a7b5e5374b",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/projects/projects_get_byId.json
b/components/camel-openstack/src/test/resources/mappings/keystone/projects/projects_get_byId.json
new file mode 100644
index 0000000..0bad1c1
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/projects/projects_get_byId.json
@@ -0,0 +1,18 @@
+{
+ "id" : "d2953b7a-f008-4ca6-8490-0c77297afd3a",
+ "name" : "projects_get_byId.json",
+ "request" : {
+ "url" : "/v3/projects/3337151a1c38496c8bffcb280b19c346",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" : "{\"project\":{\"is_domain\":false,\"description\":\"Project used
for CRUD
tests\",\"links\":{\"self\":\"http:\/\/127.0.0.1:5000\/v3\/projects\/3337151a1c38496c8bffcb280b19c346\"},\"enabled\":true,\"id\":\"3337151a1c38496c8bffcb280b19c346\",\"parent_id\":null,\"domain_id\":\"7a71863c2d1d4444b3e6c2cd36955e1e\",\"name\":\"ProjectX\"}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 200
+ },
+ "uuid" : "d2953b7a-f008-4ca6-8490-0c77297afd3a",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/projects/projects_update_response.json
b/components/camel-openstack/src/test/resources/mappings/keystone/projects/projects_update_response.json
new file mode 100644
index 0000000..6ec474e
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/projects/projects_update_response.json
@@ -0,0 +1,18 @@
+{
+ "id" : "81e5db2e-3043-401b-9cfb-61371d12822f",
+ "name" : "projects_update_response.json",
+ "request" : {
+ "url" : "/v3/projects/3337151a1c38496c8bffcb280b19c346",
+ "method" : "PATCH"
+ },
+ "response" : {
+ "body": "{\"project\":{\"is_domain\":false,\"description\":\"An updated
project used for CRUD
tests\",\"links\":{\"self\":\"http:\/\/127.0.0.1:5000\/v3\/projects\/3337151a1c38496c8bffcb280b19c346\"},\"enabled\":true,\"id\":\"3337151a1c38496c8bffcb280b19c346\",\"parent_id\":null,\"domain_id\":\"7a71863c2d1d4444b3e6c2cd36955e1e\",\"name\":\"ProjectX\",\"extra_key1\":\"value1\",\"extra_key2\":\"value2\"}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 200
+ },
+ "uuid" : "81e5db2e-3043-401b-9cfb-61371d12822f",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/projects/projects_with_options.json
b/components/camel-openstack/src/test/resources/mappings/keystone/projects/projects_with_options.json
new file mode 100644
index 0000000..01bf1ee
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/projects/projects_with_options.json
@@ -0,0 +1,18 @@
+{
+ "id" : "50d2b5ce-59a2-4073-9372-337f81d13ee5",
+ "name" : "projects_with_options.json",
+ "request" : {
+ "url" : "/v3/projects",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" :
"{\"links\":{\"self\":\"http:\/\/127.0.0.1:5000\/v3\/projects\",\"previous\":null,\"next\":null},\"projects\":[{\"is_domain\":false,\"description\":\"Tenant
for the openstack
services\",\"links\":{\"self\":\"http:\/\/127.0.0.1:5000\/v3\/projects\/10b40033bbef48f89fe838fef62398f0\"},\"tags\":[],\"enabled\":true,\"id\":\"10b40033bbef48f89fe838fef62398f0\",\"parent_id\":\"default\",\"options\":{},\"domain_id\":\"default\",\"name\":\"services\"},{\"is_domain\":false,\"descriptio
[...]
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 200
+ },
+ "uuid" : "50d2b5ce-59a2-4073-9372-337f81d13ee5",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_create_response.json
b/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_create_response.json
new file mode 100644
index 0000000..8d60ed5
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_create_response.json
@@ -0,0 +1,18 @@
+{
+ "id" : "22265785-c287-4a4c-9d90-8481ad57c1eb",
+ "name" : "regions_create_response.json",
+ "request" : {
+ "url" : "/v3/regions",
+ "method" : "POST"
+ },
+ "response" : {
+ "body" : "{\"region\":{\"id\":\"Region_CRUD\",\"description\":\"No
description provided.\",\"parent_region_id\":\"RegionOne\"}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 201
+ },
+ "uuid" : "22265785-c287-4a4c-9d90-8481ad57c1eb",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_delete.json
b/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_delete.json
new file mode 100644
index 0000000..f95907b
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_delete.json
@@ -0,0 +1,20 @@
+{
+ "id" : "c76fbdcd-3528-49fa-9062-260043f62b12",
+ "name" : "regions_delete.json",
+ "request" : {
+ "url" : "/v3/regions/Region_CRUD",
+ "method" : "DELETE"
+ },
+ "response" : {
+ "status" : 204,
+ "headers" : {
+ "Date": "Wed, 16 Mar 2016 15:01:58 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-d428e41d-104e-4d70-ba47-0878e914b200"
+ }
+ },
+ "uuid" : "c76fbdcd-3528-49fa-9062-260043f62b12",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_get_byId.json
b/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_get_byId.json
new file mode 100644
index 0000000..b529de4
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_get_byId.json
@@ -0,0 +1,18 @@
+{
+ "id" : "2ae1f597-9421-424e-a98d-02b1ad3db3ae",
+ "name" : "regions_get_byId.json",
+ "request" : {
+ "url" : "/v3/regions/Region_CRUD",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" :
"{\"region\":{\"parent_region_id\":\"RegionOne\",\"id\":\"Region_CRUD\",\"links\":{\"self\":\"http:\/\/127.0.0.1:5000\/v3\/regions\/Region_CRUD\"},\"description\":\"No
description provided.\"}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 200
+ },
+ "uuid" : "2ae1f597-9421-424e-a98d-02b1ad3db3ae",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_get_nonExistent.json
b/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_get_nonExistent.json
new file mode 100644
index 0000000..56996fe
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_get_nonExistent.json
@@ -0,0 +1,22 @@
+{
+ "id" : "f8df5e9e-d4bc-480c-8ee3-0227fa41daee",
+ "name" : "regions_get_nonExistent.json",
+ "request" : {
+ "url" : "/v3/regions/nonExistentRegionId",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" : "{\"error\":{\"message\":\"Could not find region:
nonExistentRegionIda\",\"code\":404,\"title\":\"Not Found\"}}",
+ "headers" : {
+ "Content-Type": "application/json",
+ "Date": "Wed, 16 Mar 2016 15:01:58 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-9699ed7f-05d3-4e0c-86e9-09f2744f7362"
+ },
+ "status" : 404
+ },
+ "uuid" : "f8df5e9e-d4bc-480c-8ee3-0227fa41daee",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_list.json
b/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_list.json
new file mode 100644
index 0000000..ab2b0e7
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_list.json
@@ -0,0 +1,22 @@
+{
+ "id" : "ded84235-4119-4322-a3eb-610db51d9c5d",
+ "name" : "regions_list.json",
+ "request" : {
+ "url" : "/v3/regions",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" :
"{\"regions\":[{\"parent_region_id\":null,\"id\":\"RegionOne\",\"links\":{\"self\":\"http:\/\/devstack.openstack.stack:5000\/v3\/regions\/RegionOne\"},\"description\":\"\"},{\"parent_region_id\":\"RegionOne\",\"id\":\"Region_CRUD\",\"links\":{\"self\":\"http:\/\/devstack.openstack.stack:5000\/v3\/regions\/Region_CRUD\"},\"description\":\"A
region used for CRUD
tests.\"}],\"links\":{\"self\":\"http:\/\/devstack.openstack.stack:5000\/v3\/regions\",\"previous\":null,\"next\":null}}",
+ "headers" : {
+ "Content-Type": "application/json",
+ "Date": "Wed, 16 Mar 2016 15:01:58 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-3bda5b96-7a40-4125-a82c-0362e08af1e9"
+ },
+ "status" : 200
+ },
+ "uuid" : "ded84235-4119-4322-a3eb-610db51d9c5d",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_update_response.json
b/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_update_response.json
new file mode 100644
index 0000000..544fed6
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/regions/regions_update_response.json
@@ -0,0 +1,18 @@
+{
+ "id" : "c966b263-358f-4ec3-aa05-3f39a370de80",
+ "name" : "regions_update_response.json",
+ "request" : {
+ "url" : "/v3/regions/Region_CRUD",
+ "method" : "PATCH"
+ },
+ "response" : {
+ "body":
"{\"region\":{\"parent_region_id\":\"RegionOne\",\"id\":\"Region_CRUD\",\"links\":{\"self\":\"http:\/\/127.0.0.1:5000\/v3\/regions\/Region_CRUD\"},\"description\":\"A
updated region used for CRUD tests.\"}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 200
+ },
+ "uuid" : "c966b263-358f-4ec3-aa05-3f39a370de80",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/users/create_user.json
b/components/camel-openstack/src/test/resources/mappings/keystone/users/create_user.json
new file mode 100644
index 0000000..cb2ce72
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/users/create_user.json
@@ -0,0 +1,18 @@
+{
+ "id" : "c9f071d2-2a46-43bd-bdad-0644df510d5c",
+ "name" : "create_user.json",
+ "request" : {
+ "url" : "/v3/users",
+ "method" : "POST"
+ },
+ "response" : {
+ "body" :
"{\"user\":{\"name\":\"foobar\",\"links\":{\"self\":\"http:\/\/devstack.openstack.stack:35357\/v3\/users\/29d5aaaa6d3b471e9c101ae470e649a6\"},\"domain_id\":\"default\",\"enabled\":true,\"email\":\"[email protected]\",\"description\":\"a
new
user\",\"default_project_id\":\"123ac695d4db400a9001b91bb3b8aa46\",\"id\":\"29d5aaaa6d3b471e9c101ae470e649a6\"}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 201
+ },
+ "uuid" : "c9f071d2-2a46-43bd-bdad-0644df510d5c",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/users/update_user.json
b/components/camel-openstack/src/test/resources/mappings/keystone/users/update_user.json
new file mode 100644
index 0000000..297e313
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/users/update_user.json
@@ -0,0 +1,18 @@
+{
+ "id" : "7c43c266-253a-489e-bef5-5c4c882b153c",
+ "name" : "update_user.json",
+ "request" : {
+ "url" : "/v3/users/29d5aaaa6d3b471e9c101ae470e649a6",
+ "method" : "PATCH"
+ },
+ "response" : {
+ "body":
"{\"user\":{\"name\":\"foobar\",\"links\":{\"self\":\"http:\/\/devstack.openstack,stack:5000\/v3\/users\/29d5aaaa6d3b471e9c101ae470e649a6\"},\"extra\":{\"email\":\"[email protected]\",\"links\":{\"self\":\"http:\/\/devstack.openstack.stack:5000\/v3\/users\/29d5aaaa6d3b471e9c101ae470e649a6\"}},\"domain_id\":\"default\",\"enabled\":true,\"id\":\"29d5aaaa6d3b471e9c101ae470e649a6\",\"email\":\"[email protected]\"}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 200
+ },
+ "uuid" : "7c43c266-253a-489e-bef5-5c4c882b153c",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/users/user_delete.json
b/components/camel-openstack/src/test/resources/mappings/keystone/users/user_delete.json
new file mode 100644
index 0000000..0905a94
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/users/user_delete.json
@@ -0,0 +1,20 @@
+{
+ "id" : "36204957-321b-4a69-8a14-fb8efa016de3",
+ "name" : "user_delete.json",
+ "request" : {
+ "url" : "/v3/users/29d5aaaa6d3b471e9c101ae470e649a6",
+ "method" : "DELETE"
+ },
+ "response" : {
+ "status" : 204,
+ "headers" : {
+ "Date": "Wed, 16 Mar 2016 15:01:58 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-d428e41d-104e-4d70-ba47-0878e914b200"
+ }
+ },
+ "uuid" : "36204957-321b-4a69-8a14-fb8efa016de3",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/users/user_get_byId.json
b/components/camel-openstack/src/test/resources/mappings/keystone/users/user_get_byId.json
new file mode 100644
index 0000000..2f6579c
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/users/user_get_byId.json
@@ -0,0 +1,18 @@
+{
+ "id" : "6c90b04b-9872-445c-ac34-e02bfffa03a9",
+ "name" : "user_get_byId.json",
+ "request" : {
+ "url" : "/v3/users/29d5aaaa6d3b471e9c101ae470e649a6",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" :
"{\"user\":{\"domain_id\":\"default\",\"name\":\"foobar\",\"links\":{\"self\":\"http:\/\/devstack.openstack.stack:5000\/v3\/users\/29d5aaaa6d3b471e9c101ae470e649a6\"},\"id\":\"29d5aaaa6d3b471e9c101ae470e649a6\",\"enabled\":true,\"email\":null,\"default_project_id\":\"123ac695d4db400a9001b91bb3b8aa46\"}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 200
+ },
+ "uuid" : "6c90b04b-9872-445c-ac34-e02bfffa03a9",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/keystone/users/users.json
b/components/camel-openstack/src/test/resources/mappings/keystone/users/users.json
new file mode 100644
index 0000000..26a6d72
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/keystone/users/users.json
@@ -0,0 +1,22 @@
+{
+ "id" : "c3b1cc4a-3200-4f28-a1db-d68a157110c9",
+ "name" : "users.json",
+ "request" : {
+ "url" : "/v3/users",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" :
"{\"users\":[{\"name\":\"glance\",\"links\":{\"self\":\"http:\/\/devstack.openstack.stack:35357\/v3\/users\/07cfb841cddd46819e3dcd5df238ae04\"},\"domain_id\":\"default\",\"enabled\":true,\"email\":null,\"id\":\"07cfb841cddd46819e3dcd5df238ae04\"},{\"name\":\"demo\",\"links\":{\"self\":\"http:\/\/devstack.openstack.stack:35357\/v3\/users\/11ba3db90590446fb6d7e0efe6c1f46a\"},\"domain_id\":\"default\",\"enabled\":true,\"email\":\"[email protected]\",\"id\":\"11ba3db90590446fb6d7
[...]
+ "headers" : {
+ "Content-Type": "application/json",
+ "Date": "Wed, 16 Mar 2016 15:01:58 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-3bda5b96-7a40-4125-a82c-0362e08af1e9"
+ },
+ "status" : 200
+ },
+ "uuid" : "c3b1cc4a-3200-4f28-a1db-d68a157110c9",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/neutron/networks/network.json
b/components/camel-openstack/src/test/resources/mappings/neutron/networks/network.json
new file mode 100644
index 0000000..9951b55
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/neutron/networks/network.json
@@ -0,0 +1,18 @@
+{
+ "id" : "c9cd2086-3aed-4e30-a774-74bf0ab45483",
+ "name" : "network.json",
+ "request" : {
+ "url" : "/v2.0/networks/4e8e5957-649f-477b-9e5b-f1f75b21c03c",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" :
"{\"network\":{\"status\":\"ACTIVE\",\"subnets\":[],\"name\":\"net1\",\"admin_state_up\":true,\"tenant_id\":\"9bacb3c5d39d41a79512987f338cf177\",\"segments\":[{\"provider:segmentation_id\":2,\"provider:physical_network\":\"8bab8453-1bc9-45af-8c70-f83aa9b50453\",\"provider:network_type\":\"vlan\"},{\"provider:segmentation_id\":null,\"provider:physical_network\":\"8bab8453-1bc9-45af-8c70-f83aa9b50453\",\"provider:network_type\":\"stt\"}],\"shared\":false,\"port_security_enable
[...]
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 200
+ },
+ "uuid" : "c9cd2086-3aed-4e30-a774-74bf0ab45483",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/neutron/networks/network_delete.json
b/components/camel-openstack/src/test/resources/mappings/neutron/networks/network_delete.json
new file mode 100644
index 0000000..63b23c0
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/neutron/networks/network_delete.json
@@ -0,0 +1,20 @@
+{
+ "id" : "2dafd863-ec9e-40aa-8e38-002006b6fc2c",
+ "name" : "network_delete.json",
+ "request" : {
+ "url" : "/v2.0/networks/4e8e5957-649f-477b-9e5b-f1f75b21c03c",
+ "method" : "DELETE"
+ },
+ "response" : {
+ "status" : 204,
+ "headers" : {
+ "Date": "Wed, 16 Mar 2016 15:01:58 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-e4b30959-e338-4c4a-be4b-180b5edb03d3"
+ }
+ },
+ "uuid" : "2dafd863-ec9e-40aa-8e38-002006b6fc2c",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/neutron/networks/network_external.json
b/components/camel-openstack/src/test/resources/mappings/neutron/networks/network_external.json
new file mode 100644
index 0000000..c63a1b9
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/neutron/networks/network_external.json
@@ -0,0 +1,18 @@
+{
+ "id" : "d8c54bc8-ddc6-4c93-80ee-f474581a62ac",
+ "name" : "network_external.json",
+ "request" : {
+ "url" : "/v2.0/networks",
+ "method" : "POST"
+ },
+ "response" : {
+ "body" :
"{\"network\":{\"status\":\"ACTIVE\",\"subnets\":[],\"name\":\"net1\",\"admin_state_up\":true,\"tenant_id\":\"9bacb3c5d39d41a79512987f338cf177\",\"segments\":[{\"provider:segmentation_id\":2,\"provider:physical_network\":\"8bab8453-1bc9-45af-8c70-f83aa9b50453\",\"provider:network_type\":\"vlan\"},{\"provider:segmentation_id\":null,\"provider:physical_network\":\"8bab8453-1bc9-45af-8c70-f83aa9b50453\",\"provider:network_type\":\"stt\"}],\"router:external\":true,\"shared\":fal
[...]
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 201
+ },
+ "uuid" : "d8c54bc8-ddc6-4c93-80ee-f474581a62ac",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/neutron/networks/networks_filtered.json
b/components/camel-openstack/src/test/resources/mappings/neutron/networks/networks_filtered.json
new file mode 100644
index 0000000..397281d
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/neutron/networks/networks_filtered.json
@@ -0,0 +1,22 @@
+{
+ "id" : "4385766e-5070-403d-9e7f-cf43ccb8f26e",
+ "name" : "networks_filtered.json",
+ "request" : {
+ "url" : "/v2.0/networks",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" :
"{\"networks\":[{\"status\":\"ACTIVE\",\"subnets\":[\"0c4faf33-8c23-4dc9-8bf5-30dd1ab452f9\"],\"name\":\"net1\",\"provider:physical_network\":null,\"admin_state_up\":true,\"tenant_id\":\"9712d107d5f9445a9fc5b4108502e312\",\"mtu\":0,\"router:external\":true,\"shared\":true,\"provider:network_type\":\"vxlan\",\"id\":\"73f6f1ac-5e58-4801-88c3-7e12c6ddfb39\",\"provider:segmentation_id\":101101,\"created_at\":\"2020-10-30T22:16:01Z\",\"updated_at\":\"2020-10-30T22:16:01Z\"}]}",
+ "headers" : {
+ "Content-Type": "application/json",
+ "Date": "Wed, 16 Mar 2016 15:01:58 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-6e244e09-3016-4a19-8b6d-f9872f5ac66e"
+ },
+ "status" : 200
+ },
+ "uuid" : "4385766e-5070-403d-9e7f-cf43ccb8f26e",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/neutron/ports/port_external.json
b/components/camel-openstack/src/test/resources/mappings/neutron/ports/port_external.json
new file mode 100644
index 0000000..ed34646
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/neutron/ports/port_external.json
@@ -0,0 +1,18 @@
+{
+ "id" : "a0f01c14-436c-423c-bb68-8f4314a5cf77",
+ "name" : "port_external.json",
+ "request" : {
+ "url" : "/v2.0/ports",
+ "method" : "POST"
+ },
+ "response" : {
+ "body" :
"{\"port\":{\"network_id\":\"a87cc70a-3e15-4acf-8205-9b711a3531b7\",\"binding:host_id\":\"4df8d9ff-6f6f-438f-90a1-ef660d4586ad\",\"binding:profile\":{\"local_link_information\":[{\"port_id\":\"Ethernet3\/1\",\"switch_id\":\"0a:1b:2c:3d:4e:5f\",\"switch_info\":\"switch1\"}]},\"binding:vnic_type\":\"baremetal\",\"device_id\":\"d90a13da-be41-461f-9f99-1dbcf438fdf2\",\"device_owner\":\"baremetal:none\",\"allowed_address_pairs\":[{\"ip_address\":\"192.168.0.100\",\"mac_address\":
[...]
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 201
+ },
+ "uuid" : "a0f01c14-436c-423c-bb68-8f4314a5cf77",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/neutron/ports/ports_external.json
b/components/camel-openstack/src/test/resources/mappings/neutron/ports/ports_external.json
new file mode 100644
index 0000000..97425e0
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/neutron/ports/ports_external.json
@@ -0,0 +1,22 @@
+{
+ "id" : "f57e2ac3-7897-424f-bde5-85bf1f961bcb",
+ "name" : "ports_external.json",
+ "request" : {
+ "url" : "/v2.0/ports",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" :
"{\"ports\":[{\"admin_state_up\":false,\"data_plane_status\":null,\"description\":\"\",\"device_id\":\"\",\"device_owner\":\"\",\"fixed_ips\":[{\"ip_address\":\"10.0.0.5\",\"subnet_id\":\"a0304c3a-4f08-4c43-88af-d796509c97d2\"}],\"allowed_address_pairs\":[{\"ip_address\":\"192.168.0.100\",\"mac_address\":\"00:60:2f:38:62:8d\"}],\"id\":\"94225baa-9d3f-4b93-bf12-b41e7ce49cdb\",\"mac_address\":\"fa:16:3e:48:b8:9f\",\"name\":\"sample_port_1\",\"network_id\":\"a87cc70a-3e15-4acf-
[...]
+ "headers" : {
+ "Content-Type": "application/json",
+ "Date": "Wed, 16 Mar 2016 15:01:58 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-55376b13-eb5b-47cc-baac-7b8fe7bc00a3"
+ },
+ "status" : 200
+ },
+ "uuid" : "f57e2ac3-7897-424f-bde5-85bf1f961bcb",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/neutron/subnets/subnet_ipv6.json
b/components/camel-openstack/src/test/resources/mappings/neutron/subnets/subnet_ipv6.json
new file mode 100644
index 0000000..e1e38bd
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/neutron/subnets/subnet_ipv6.json
@@ -0,0 +1,18 @@
+{
+ "id" : "b6ace88f-27a9-4459-8add-5b67a6f5939f",
+ "name" : "subnet_ipv6.json",
+ "request" : {
+ "url" : "/v2.0/subnets/3b80198d-4f7b-4f77-9ef5-774d54e17126",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" :
"{\"subnet\":{\"name\":\"sub1\",\"enable_dhcp\":true,\"network_id\":\"d32019d3-bc6e-4319-9c1d-6722fc136a22\",\"segment_id\":null,\"project_id\":\"4fd44f30292945e481c7b8a0c8908869\",\"tenant_id\":\"4fd44f30292945e481c7b8a0c8908869\",\"dns_nameservers\":[],\"allocation_pools\":[{\"start\":\"2620:0:2d0:200::2\",\"end\":\"2620:0:2d0:200:ffff:ffff:ffff:fffe\"}],\"host_routes\":[],\"ip_version\":6,\"gateway_ip\":\"2620:0:2d0:200::1\",\"cidr\":\"2620:0:2d0:200::\/64\",\"id\":\"3b80
[...]
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 200
+ },
+ "uuid" : "b6ace88f-27a9-4459-8add-5b67a6f5939f",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/nova/flavors/flavor.json
b/components/camel-openstack/src/test/resources/mappings/nova/flavors/flavor.json
new file mode 100644
index 0000000..745e7b2
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/nova/flavors/flavor.json
@@ -0,0 +1,18 @@
+{
+ "id" : "248a9292-e129-4dbf-b83b-33f62e78d0d0",
+ "name" : "flavor.json",
+ "request" : {
+ "url" : "/v2/123ac695d4db400a9001b91bb3b8aa46/flavors/1",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" :
"{\"flavor\":{\"disk\":1,\"id\":\"1\",\"links\":[{\"href\":\"http:\/\/openstack.example.com\/v2\/openstack\/flavors\/1\",\"rel\":\"self\"},{\"href\":\"http:\/\/openstack.example.com\/openstack\/flavors\/1\",\"rel\":\"bookmark\"}],\"name\":\"m1.tiny\",\"ram\":512,\"os-flavor-access:is_public\":true,\"OS-FLV-EXT-DATA:ephemeral\":0,\"OS-FLV-DISABLED:disabled\":false,\"rxtx_factor\":2,\"vcpus\":1}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 200
+ },
+ "uuid" : "248a9292-e129-4dbf-b83b-33f62e78d0d0",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/nova/flavors/flavor_create.json
b/components/camel-openstack/src/test/resources/mappings/nova/flavors/flavor_create.json
new file mode 100644
index 0000000..695e117
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/nova/flavors/flavor_create.json
@@ -0,0 +1,18 @@
+{
+ "id" : "2c009df7-b577-4fc6-94ca-0309f623f945",
+ "name" : "flavor_create.json",
+ "request" : {
+ "url" : "/v2/123ac695d4db400a9001b91bb3b8aa46/flavors",
+ "method" : "POST"
+ },
+ "response" : {
+ "body" :
"{\"flavor\":{\"vcpus\":1,\"disk\":2,\"name\":\"m1.tiny\",\"os-flavor-access:is_public\":true,\"rxtx_factor\":2,\"OS-FLV-EXT-DATA:ephemeral\":1,\"ram\":128,\"id\":\"1\",\"swap\":1}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 201
+ },
+ "uuid" : "2c009df7-b577-4fc6-94ca-0309f623f945",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/nova/flavors/flavors_detailed.json
b/components/camel-openstack/src/test/resources/mappings/nova/flavors/flavors_detailed.json
new file mode 100644
index 0000000..d9e99f4
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/nova/flavors/flavors_detailed.json
@@ -0,0 +1,22 @@
+{
+ "id" : "d12f65db-167e-4460-842b-e416ca93971c",
+ "name" : "flavors_detailed.json",
+ "request" : {
+ "url" : "/v2/123ac695d4db400a9001b91bb3b8aa46/flavors/detail",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" :
"{\"flavors\":[{\"name\":\"m1.nano\",\"links\":[{\"href\":\"http:\/\/openstack.example.com:8774\/v2.1\/8fd2b4f2b5cf4fa184e5c3c5020408c7\/flavors\/0\",\"rel\":\"self\"},{\"href\":\"http:\/\/openstack.example.com:8774\/8fd2b4f2b5cf4fa184e5c3c5020408c7\/flavors\/0\",\"rel\":\"bookmark\"}],\"ram\":64,\"OS-FLV-DISABLED:disabled\":false,\"vcpus\":1,\"swap\":\"\",\"os-flavor-access:is_public\":true,\"rxtx_factor\":1,\"OS-FLV-EXT-DATA:ephemeral\":0,\"disk\":1,\"id\":\"0\"},{\"name\"
[...]
+ "headers" : {
+ "Content-Type": "application/json",
+ "Date": "Wed, 16 Mar 2016 15:01:58 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-243415fd-ddf2-428c-a3d9-e9a77f54ef97"
+ },
+ "status" : 200
+ },
+ "uuid" : "d12f65db-167e-4460-842b-e416ca93971c",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/nova/servers/server_create.json
b/components/camel-openstack/src/test/resources/mappings/nova/servers/server_create.json
new file mode 100644
index 0000000..3b65802
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/nova/servers/server_create.json
@@ -0,0 +1,18 @@
+{
+ "id" : "8cf6f5d4-0dcf-46e4-b40b-b076c8b8ca6d",
+ "name" : "server_create.json",
+ "request" : {
+ "url" : "/v2/123ac695d4db400a9001b91bb3b8aa46/servers",
+ "method" : "POST"
+ },
+ "response" : {
+ "body" :
"{\"server\":{\"name\":\"server-test-1\",\"imageRef\":\"b5660a6e-4b46-4be3-9707-6b47221b454f\",\"flavorRef\":\"2\",\"max_count\":1,\"min_count\":1,\"networks\":[{\"uuid\":\"d32019d3-bc6e-4319-9c1d-6722fc136a22\"}],\"security_groups\":[{\"name\":\"default\"},{\"name\":\"another-secgroup-name\"}]}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 201
+ },
+ "uuid" : "8cf6f5d4-0dcf-46e4-b40b-b076c8b8ca6d",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/nova/servers/server_snapshot_create.json
b/components/camel-openstack/src/test/resources/mappings/nova/servers/server_snapshot_create.json
new file mode 100644
index 0000000..9c43254
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/nova/servers/server_snapshot_create.json
@@ -0,0 +1,17 @@
+{
+ "id" : "505c6364-5e64-4924-b088-9e28c58e7715",
+ "name" : "server_snapshot_create.json",
+ "request" : {
+ "url" :
"/v2/123ac695d4db400a9001b91bb3b8aa46/servers/e565cbdb-8e74-4044-ba6e-0155500b2c46/action",
+ "method" : "POST"
+ },
+ "response" : {
+ "headers" : {
+ "location" :
"http://127.0.0.1:9292/images/72f759b3-2576-4bf0-9ac9-7cb4a5b9d541"
+ },
+ "status" : 202
+ },
+ "uuid" : "505c6364-5e64-4924-b088-9e28c58e7715",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/nova/servers/server_wrong_id_get.json
b/components/camel-openstack/src/test/resources/mappings/nova/servers/server_wrong_id_get.json
new file mode 100644
index 0000000..6e0e874
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/nova/servers/server_wrong_id_get.json
@@ -0,0 +1,18 @@
+{
+ "id" : "fdf3d230-fab3-402f-98a0-394506bb8502",
+ "name" : "server_wrong_id_get.json.json",
+ "request" : {
+ "url" :
"/v2/123ac695d4db400a9001b91bb3b8aa46/servers/05184ba3-00ba-4fbc-b7a2-03b62b884931",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" : "{\"computeFault\":{\"message\":\"The server has either erred or
is incapable of performing the requested operation.\",\"code\":500}}",
+ "headers" : {
+ "Content-Type" : "application/json; charset=UTF-8"
+ },
+ "status" : 500
+ },
+ "uuid" : "fdf3d230-fab3-402f-98a0-394506bb8502",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/nova/servers/servers.json
b/components/camel-openstack/src/test/resources/mappings/nova/servers/servers.json
new file mode 100644
index 0000000..8001210
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/nova/servers/servers.json
@@ -0,0 +1,22 @@
+{
+ "id" : "b5c808b7-c7fb-46c4-b05e-2f05e1e8c74d",
+ "name" : "servers.json",
+ "request" : {
+ "url" : "/v2/123ac695d4db400a9001b91bb3b8aa46/servers/detail",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" :
"{\"servers\":[{\"accessIPv4\":\"\",\"accessIPv6\":\"\",\"addresses\":{\"private\":[{\"addr\":\"192.168.0.3\",\"version\":4}]},\"created\":\"2012-09-07T16:56:37Z\",\"flavor\":{\"id\":\"1\",\"links\":[{\"href\":\"http://openstack.example.com/openstack/flavors/1\",\"rel\":\"bookmark\"}]},\"hostId\":\"16d193736a5cfdb60c697ca27ad071d6126fa13baeb670fc9d10645e\",\"id\":\"05184ba3-00ba-4fbc-b7a2-03b62b884931\",\"image\":{\"id\":\"70a599e0-31e7-49b7-b260-868f441e862b\",\"links\":[{\
[...]
+ "headers" : {
+ "Content-Type": "application/json",
+ "Date": "Wed, 16 Mar 2016 15:01:58 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-a20cfd3c-5d67-40f7-9aa4-5fdf47951e5e"
+ },
+ "status" : 200
+ },
+ "uuid" : "b5c808b7-c7fb-46c4-b05e-2f05e1e8c74d",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/swift/containers/container_metadata_get.json
b/components/camel-openstack/src/test/resources/mappings/swift/containers/container_metadata_get.json
new file mode 100644
index 0000000..a041372
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/swift/containers/container_metadata_get.json
@@ -0,0 +1,18 @@
+{
+ "id" : "69b9a27f-0346-4230-b2c2-45cfd4d17139",
+ "name" : "container_metadata_get.json",
+ "request" : {
+ "url" : "/12345321ae80457abc3728fa1e6feb78/myContainer",
+ "method" : "HEAD"
+ },
+ "response" : {
+ "status" : 204,
+ "headers" : {
+ "X-Container-Meta-Year": "2000",
+ "X-Container-Meta-Book": "TestBook"
+ }
+ },
+ "uuid" : "69b9a27f-0346-4230-b2c2-45cfd4d17139",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/swift/containers/containers.json
b/components/camel-openstack/src/test/resources/mappings/swift/containers/containers.json
new file mode 100644
index 0000000..c29f12a
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/swift/containers/containers.json
@@ -0,0 +1,22 @@
+{
+ "id" : "f4cf104c-a8b7-41a8-b571-d53d7391f9c2",
+ "name" : "containers.json",
+ "request" : {
+ "url" : "/12345321ae80457abc3728fa1e6feb78/?format=json",
+ "method" : "GET"
+ },
+ "response" : {
+ "body" :
"[{\"count\":2,\"bytes\":100,\"name\":\"Test\"},{\"count\":1,\"bytes\":14,\"name\":\"marktwain\"}]",
+ "headers" : {
+ "Content-Type": "application/json",
+ "Date": "Wed, 16 Mar 2016 15:01:58 GMT",
+ "Server": "Apache/2.4.7 (Ubuntu)",
+ "Vary": "X-Auth-Token",
+ "x-openstack-request-id": "req-9b8d6e0d-8d2c-4ebc-b26b-7c0de628723a"
+ },
+ "status" : 200
+ },
+ "uuid" : "f4cf104c-a8b7-41a8-b571-d53d7391f9c2",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git
a/components/camel-openstack/src/test/resources/mappings/swift/objects/object_get.json
b/components/camel-openstack/src/test/resources/mappings/swift/objects/object_get.json
new file mode 100644
index 0000000..d17a2a8
--- /dev/null
+++
b/components/camel-openstack/src/test/resources/mappings/swift/objects/object_get.json
@@ -0,0 +1,19 @@
+{
+ "id" : "cc8dbfce-477c-4119-a388-5ecfcd642336",
+ "name" : "object_get.json",
+ "request" : {
+ "url" : "/12345321ae80457abc3728fa1e6feb78/test-container/test-file",
+ "method" : "HEAD"
+ },
+ "response" : {
+ "headers" : {
+ "Content-Length" : "15",
+ "Content-Type" : "application/json",
+ "ETag" : "12345678901234567890"
+ },
+ "status" : 200
+ },
+ "uuid" : "cc8dbfce-477c-4119-a388-5ecfcd642336",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file