JCLOUDS-805: Fixed BucketApiLiveTest Failures

This commit is contained in:
hsbhathiya 2015-01-24 03:51:17 +05:30 committed by Andrew Gaul
parent c7c2581f50
commit cf6d316bd0
2 changed files with 6 additions and 4 deletions

View File

@ -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);
}

View File

@ -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());