diff --git a/apis/openstack-cinder/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata b/apis/openstack-cinder/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata index b007ce5e30..083e7f77c7 100644 --- a/apis/openstack-cinder/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata +++ b/apis/openstack-cinder/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata @@ -1 +1,18 @@ -org.jclouds.openstack.cinder.v1.CinderApiMetadata \ No newline at end of file +# +# 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. +# + +org.jclouds.openstack.cinder.v1.CinderApiMetadata diff --git a/apis/openstack-cinder/src/test/java/org/jclouds/openstack/cinder/v1/features/SnapshotApiExpectTest.java b/apis/openstack-cinder/src/test/java/org/jclouds/openstack/cinder/v1/features/SnapshotApiExpectTest.java index 48d5ed7c78..9ab2e33dc6 100644 --- a/apis/openstack-cinder/src/test/java/org/jclouds/openstack/cinder/v1/features/SnapshotApiExpectTest.java +++ b/apis/openstack-cinder/src/test/java/org/jclouds/openstack/cinder/v1/features/SnapshotApiExpectTest.java @@ -17,8 +17,8 @@ package org.jclouds.openstack.cinder.v1.features; import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNull; import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; import java.net.URI; @@ -29,6 +29,7 @@ import javax.ws.rs.core.MediaType; import org.jclouds.date.DateService; import org.jclouds.date.internal.SimpleDateFormatDateService; import org.jclouds.http.HttpResponse; +import org.jclouds.io.Payloads; import org.jclouds.openstack.cinder.v1.domain.Snapshot; import org.jclouds.openstack.cinder.v1.domain.Volume; import org.jclouds.openstack.cinder.v1.internal.BaseCinderApiExpectTest; @@ -39,6 +40,7 @@ import org.testng.annotations.Test; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; +import com.google.common.io.ByteSource; /** * Tests SnapshotApi Guice wiring and parsing @@ -144,7 +146,7 @@ public class SnapshotApiExpectTest extends BaseCinderApiExpectTest { .build(), HttpResponse.builder().statusCode(200).payload(payloadFromResource("/snapshot_create_response.json")).build() ).getSnapshotApiForZone("RegionOne"); - + CreateSnapshotOptions options = CreateSnapshotOptions.Builder .name("jclouds-test-snapshot") .description("jclouds test snapshot") @@ -166,7 +168,7 @@ public class SnapshotApiExpectTest extends BaseCinderApiExpectTest { .build(), HttpResponse.builder().statusCode(404).build() ).getSnapshotApiForZone("RegionOne"); - + CreateSnapshotOptions options = CreateSnapshotOptions.Builder .name("jclouds-test-snapshot") .description("jclouds test snapshot") @@ -187,10 +189,12 @@ public class SnapshotApiExpectTest extends BaseCinderApiExpectTest { .build(), HttpResponse.builder() .statusCode(400) - .payload("{\"badRequest\": {\"message\": \"Invalid volume: must be available\", \"code\": 400}}") + .payload(Payloads.newByteSourcePayload(ByteSource + .wrap("{\"badRequest\": {\"message\": \"Invalid volume: must be available\", \"code\": 400}}" + .getBytes()))) .build() ).getSnapshotApiForZone("RegionOne"); - + CreateSnapshotOptions options = CreateSnapshotOptions.Builder .name("jclouds-test-snapshot") .description("jclouds test snapshot") @@ -266,7 +270,9 @@ public class SnapshotApiExpectTest extends BaseCinderApiExpectTest { authenticatedGET().endpoint(endpoint).method("DELETE").build(), HttpResponse.builder() .statusCode(400) - .payload("{\"badRequest\": {\"message\": \"Invalid volume: Volume Snapshot status must be available or error\", \"code\": 400}}") + .payload(Payloads.newByteSourcePayload(ByteSource + .wrap("{\"badRequest\": {\"message\": \"Invalid volume: Volume Snapshot status must be available or error\", \"code\": 400}}" + .getBytes()))) .build() ).getSnapshotApiForZone("RegionOne"); diff --git a/apis/openstack-cinder/src/test/resources/quotas.json b/apis/openstack-cinder/src/test/resources/quotas.json index a50b8b5871..21b9f55203 100644 --- a/apis/openstack-cinder/src/test/resources/quotas.json +++ b/apis/openstack-cinder/src/test/resources/quotas.json @@ -1,6 +1,8 @@ -{"quota_set": { - "gigabytes": 1000, - "volumes": 10, - "snapshots": 20, - "id": "demo" -}} +{ + "quota_set": { + "gigabytes": 1000, + "volumes": 10, + "snapshots": 20, + "id": "demo" + } +} diff --git a/apis/openstack-cinder/src/test/resources/snapshot_create.json b/apis/openstack-cinder/src/test/resources/snapshot_create.json index 66b3303c20..5acecfdbc3 100644 --- a/apis/openstack-cinder/src/test/resources/snapshot_create.json +++ b/apis/openstack-cinder/src/test/resources/snapshot_create.json @@ -1 +1,8 @@ -{"snapshot":{"display_name":"jclouds-test-snapshot","volume_id":"ea6f70ef-2784-40b9-9d14-d7f33c507c3f","display_description":"jclouds test snapshot","force":"true"}} \ No newline at end of file +{ + "snapshot": { + "display_name": "jclouds-test-snapshot", + "volume_id": "ea6f70ef-2784-40b9-9d14-d7f33c507c3f", + "display_description": "jclouds test snapshot", + "force": "true" + } +} diff --git a/apis/openstack-cinder/src/test/resources/snapshot_create_response.json b/apis/openstack-cinder/src/test/resources/snapshot_create_response.json index 9aba94a0fe..5c740094f2 100644 --- a/apis/openstack-cinder/src/test/resources/snapshot_create_response.json +++ b/apis/openstack-cinder/src/test/resources/snapshot_create_response.json @@ -8,4 +8,4 @@ "id": "67d03df1-ce5d-4ba7-adbe-492ceb80170b", "size": 1 } -} \ No newline at end of file +} diff --git a/apis/openstack-cinder/src/test/resources/snapshot_get.json b/apis/openstack-cinder/src/test/resources/snapshot_get.json index 1c5d558f56..da3ff679a2 100644 --- a/apis/openstack-cinder/src/test/resources/snapshot_get.json +++ b/apis/openstack-cinder/src/test/resources/snapshot_get.json @@ -10,4 +10,4 @@ "id": "67d03df1-ce5d-4ba7-adbe-492ceb80170b", "size": 1 } -} \ No newline at end of file +} diff --git a/apis/openstack-cinder/src/test/resources/snapshot_list_details.json b/apis/openstack-cinder/src/test/resources/snapshot_list_details.json index f93736f26d..14db78562e 100644 --- a/apis/openstack-cinder/src/test/resources/snapshot_list_details.json +++ b/apis/openstack-cinder/src/test/resources/snapshot_list_details.json @@ -12,4 +12,4 @@ "size": 1 } ] -} \ No newline at end of file +} diff --git a/apis/openstack-cinder/src/test/resources/snapshot_list_simple.json b/apis/openstack-cinder/src/test/resources/snapshot_list_simple.json index 2ffb8f8949..8f5918a3ed 100644 --- a/apis/openstack-cinder/src/test/resources/snapshot_list_simple.json +++ b/apis/openstack-cinder/src/test/resources/snapshot_list_simple.json @@ -10,4 +10,4 @@ "size": 1 } ] -} \ No newline at end of file +} diff --git a/apis/openstack-cinder/src/test/resources/volume_create.json b/apis/openstack-cinder/src/test/resources/volume_create.json index 6799b041e7..9bfafb7e20 100644 --- a/apis/openstack-cinder/src/test/resources/volume_create.json +++ b/apis/openstack-cinder/src/test/resources/volume_create.json @@ -1 +1,7 @@ -{"volume":{"display_name":"jclouds-test-volume","display_description":"description of test volume","size":1}} \ No newline at end of file +{ + "volume": { + "display_name": "jclouds-test-volume", + "display_description": "description of test volume", + "size": 1 + } +} diff --git a/apis/openstack-cinder/src/test/resources/volume_create_response.json b/apis/openstack-cinder/src/test/resources/volume_create_response.json index 91aaa9df77..dd6a68e8e0 100644 --- a/apis/openstack-cinder/src/test/resources/volume_create_response.json +++ b/apis/openstack-cinder/src/test/resources/volume_create_response.json @@ -12,4 +12,4 @@ "id": "60761c60-0f56-4499-b522-ff13e120af10", "size": 1 } -} \ No newline at end of file +} diff --git a/apis/openstack-cinder/src/test/resources/volume_get.json b/apis/openstack-cinder/src/test/resources/volume_get.json index c4023177d0..2d9a8ccfb8 100644 --- a/apis/openstack-cinder/src/test/resources/volume_get.json +++ b/apis/openstack-cinder/src/test/resources/volume_get.json @@ -19,4 +19,4 @@ "id": "60761c60-0f56-4499-b522-ff13e120af10", "size": 1 } -} \ No newline at end of file +} diff --git a/apis/openstack-cinder/src/test/resources/volume_list_details.json b/apis/openstack-cinder/src/test/resources/volume_list_details.json index e1a8dc8611..7de9b19a85 100644 --- a/apis/openstack-cinder/src/test/resources/volume_list_details.json +++ b/apis/openstack-cinder/src/test/resources/volume_list_details.json @@ -21,4 +21,4 @@ "size": 1 } ] -} \ No newline at end of file +} diff --git a/apis/openstack-cinder/src/test/resources/volume_list_simple.json b/apis/openstack-cinder/src/test/resources/volume_list_simple.json index e1a8dc8611..7de9b19a85 100644 --- a/apis/openstack-cinder/src/test/resources/volume_list_simple.json +++ b/apis/openstack-cinder/src/test/resources/volume_list_simple.json @@ -21,4 +21,4 @@ "size": 1 } ] -} \ No newline at end of file +} diff --git a/apis/openstack-cinder/src/test/resources/volume_type_get.json b/apis/openstack-cinder/src/test/resources/volume_type_get.json index ffda197216..0089e80021 100644 --- a/apis/openstack-cinder/src/test/resources/volume_type_get.json +++ b/apis/openstack-cinder/src/test/resources/volume_type_get.json @@ -11,4 +11,4 @@ "deleted_at": null, "id": 1 } -} \ No newline at end of file +} diff --git a/apis/openstack-cinder/src/test/resources/volume_type_list_simple.json b/apis/openstack-cinder/src/test/resources/volume_type_list_simple.json index 600c380d1c..02eb792182 100644 --- a/apis/openstack-cinder/src/test/resources/volume_type_list_simple.json +++ b/apis/openstack-cinder/src/test/resources/volume_type_list_simple.json @@ -13,4 +13,4 @@ "id": 1 } ] -} \ No newline at end of file +}