You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ga...@apache.org on 2015/02/13 22:58:30 UTC

jclouds-labs-google git commit: JCLOUDS-805: Fixed BucketApiLiveTest Failures

Repository: jclouds-labs-google
Updated Branches:
  refs/heads/master a1f28f98b -> e05dadc9a


JCLOUDS-805: Fixed BucketApiLiveTest Failures


Project: http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/commit/e05dadc9
Tree: http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/tree/e05dadc9
Diff: http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/diff/e05dadc9

Branch: refs/heads/master
Commit: e05dadc9a3531a23ac0a359a539d01f390c695de
Parents: a1f28f9
Author: hsbhathiya <hs...@gmail.com>
Authored: Sat Jan 24 03:51:17 2015 +0530
Committer: Andrew Gaul <ga...@apache.org>
Committed: Fri Feb 13 12:20:26 2015 -0800

----------------------------------------------------------------------
 .../config/GoogleCloudStorageOAuthScopes.java                | 2 ++
 .../googlecloudstorage/features/BucketApiExpectTest.java     | 8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/e05dadc9/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/config/GoogleCloudStorageOAuthScopes.java
----------------------------------------------------------------------
diff --git a/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/config/GoogleCloudStorageOAuthScopes.java b/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/config/GoogleCloudStorageOAuthScopes.java
index 8537e8b..358c9a0 100644
--- a/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/config/GoogleCloudStorageOAuthScopes.java
+++ b/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/config/GoogleCloudStorageOAuthScopes.java
@@ -45,6 +45,8 @@ import com.google.common.collect.ImmutableList;
       if (path.endsWith("/acl") || path.endsWith("/defaultObjectAcl") //
             || path.contains("/acl/") || path.contains("/defaultObjectAcl/")) {
          return fullControlScopes();
+      } else if (input.getMethod().equalsIgnoreCase("PUT") || input.getMethod().equalsIgnoreCase("PATCH")) {
+         return fullControlScopes();
       }
       return readOrWriteScopes().forRequest(input);
    }

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/e05dadc9/google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/features/BucketApiExpectTest.java
----------------------------------------------------------------------
diff --git a/google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/features/BucketApiExpectTest.java b/google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/features/BucketApiExpectTest.java
index 2cfee9b..4970b19 100644
--- a/google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/features/BucketApiExpectTest.java
+++ b/google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/features/BucketApiExpectTest.java
@@ -169,7 +169,7 @@ public class BucketApiExpectTest extends BaseGoogleCloudStorageApiExpectTest {
       HttpResponse updateResponse = HttpResponse.builder().statusCode(200)
                .payload(staticPayloadFromResource("/bucket_update_response.json")).build();
 
-      BucketApi api = requestsSendResponses(requestForScopes(STORAGE_READWRITE_SCOPE), TOKEN_RESPONSE,
+      BucketApi api = requestsSendResponses(requestForScopes(STORAGE_FULLCONTROL_SCOPE), TOKEN_RESPONSE,
                updateRequest, updateResponse).getBucketApi();
 
       assertEquals(api.updateBucket(EXPECTED_TEST_BUCKET, template), new BucketUpdateTest().expected());
@@ -197,7 +197,7 @@ public class BucketApiExpectTest extends BaseGoogleCloudStorageApiExpectTest {
       HttpResponse updateResponse = HttpResponse.builder().statusCode(200)
                .payload(staticPayloadFromResource("/bucket_update_response.json")).build();
 
-      BucketApi api = requestsSendResponses(requestForScopes(STORAGE_READWRITE_SCOPE), TOKEN_RESPONSE,
+      BucketApi api = requestsSendResponses(requestForScopes(STORAGE_FULLCONTROL_SCOPE), TOKEN_RESPONSE,
                updateRequest, updateResponse).getBucketApi();
 
       assertEquals(api.updateBucket(EXPECTED_TEST_BUCKET, template, options), new BucketUpdateTest().expected());
@@ -222,7 +222,7 @@ public class BucketApiExpectTest extends BaseGoogleCloudStorageApiExpectTest {
       HttpResponse patchResponse = HttpResponse.builder().statusCode(200)
                .payload(staticPayloadFromResource("/bucket_update_response.json")).build();
 
-      BucketApi api = requestsSendResponses(requestForScopes(STORAGE_READWRITE_SCOPE), TOKEN_RESPONSE, patchRequest,
+      BucketApi api = requestsSendResponses(requestForScopes(STORAGE_FULLCONTROL_SCOPE), TOKEN_RESPONSE, patchRequest,
                patchResponse).getBucketApi();
 
       assertEquals(api.patchBucket(EXPECTED_TEST_BUCKET, template), new BucketUpdateTest().expected());
@@ -250,7 +250,7 @@ public class BucketApiExpectTest extends BaseGoogleCloudStorageApiExpectTest {
       HttpResponse patchResponse = HttpResponse.builder().statusCode(200)
                .payload(staticPayloadFromResource("/bucket_update_response.json")).build();
 
-      BucketApi api = requestsSendResponses(requestForScopes(STORAGE_READWRITE_SCOPE), TOKEN_RESPONSE, patchRequest,
+      BucketApi api = requestsSendResponses(requestForScopes(STORAGE_FULLCONTROL_SCOPE), TOKEN_RESPONSE, patchRequest,
                patchResponse).getBucketApi();
 
       assertEquals(api.updateBucket(EXPECTED_TEST_BUCKET, template, options), new BucketUpdateTest().expected());