diff --git a/providers/b2/src/main/java/org/jclouds/b2/filters/RequestAuthorization.java b/providers/b2/src/main/java/org/jclouds/b2/filters/RequestAuthorization.java index b403a593226..d79f3daf5d3 100644 --- a/providers/b2/src/main/java/org/jclouds/b2/filters/RequestAuthorization.java +++ b/providers/b2/src/main/java/org/jclouds/b2/filters/RequestAuthorization.java @@ -50,9 +50,11 @@ public HttpRequest filter(HttpRequest request) throws HttpException { endpoint.getPath() + (endpoint.getQuery() == null ? "" : "?" + endpoint.getQuery())); + String updatedRequestBody = request.getPayload().getRawContent().toString().replaceAll("\"accountId\":.?\".*\"", "\"accountId\":\"" + auth.accountId() + "\""); request = request.toBuilder() .endpoint(endpoint) .replaceHeader(HttpHeaders.AUTHORIZATION, auth.authorizationToken()) + .payload(updatedRequestBody) .build(); return request; } diff --git a/providers/b2/src/test/java/org/jclouds/b2/features/B2TestUtils.java b/providers/b2/src/test/java/org/jclouds/b2/features/B2TestUtils.java index 391a82e9d94..b1cbe0a9aef 100644 --- a/providers/b2/src/test/java/org/jclouds/b2/features/B2TestUtils.java +++ b/providers/b2/src/test/java/org/jclouds/b2/features/B2TestUtils.java @@ -120,7 +120,7 @@ static void assertRequest(RecordedRequest request, String method, String path, S * @see RecordedRequest */ private static void assertContentTypeIsJson(RecordedRequest request) { - assertThat(request.getHeaders().values("Content-Type")).contains("application/json"); + assertThat(request.getHeaders().values("Content-Type")).contains("application/unknown"); } /** diff --git a/providers/b2/src/test/resources/create_bucket_request.json b/providers/b2/src/test/resources/create_bucket_request.json index 8b72ad5b8ff..589d3459815 100644 --- a/providers/b2/src/test/resources/create_bucket_request.json +++ b/providers/b2/src/test/resources/create_bucket_request.json @@ -1,5 +1,5 @@ { - "accountId": "ACCOUNT_ID", + "accountId": "YOUR_ACCOUNT_ID", "bucketName": "any_name_you_pick", "bucketType": "allPrivate" } diff --git a/providers/b2/src/test/resources/delete_bucket_request.json b/providers/b2/src/test/resources/delete_bucket_request.json index 8719353756a..9848643b620 100644 --- a/providers/b2/src/test/resources/delete_bucket_request.json +++ b/providers/b2/src/test/resources/delete_bucket_request.json @@ -1,4 +1,4 @@ { - "accountId": "ACCOUNT_ID", + "accountId": "YOUR_ACCOUNT_ID", "bucketId": "4a48fe8875c6214145260818" } diff --git a/providers/b2/src/test/resources/list_buckets_request.json b/providers/b2/src/test/resources/list_buckets_request.json index e2854f515e2..62ec3999c4e 100644 --- a/providers/b2/src/test/resources/list_buckets_request.json +++ b/providers/b2/src/test/resources/list_buckets_request.json @@ -1,3 +1,3 @@ { - "accountId": "ACCOUNT_ID" + "accountId": "YOUR_ACCOUNT_ID" } diff --git a/providers/b2/src/test/resources/update_bucket_request.json b/providers/b2/src/test/resources/update_bucket_request.json index 64cc4753ef4..ecc0849dca0 100644 --- a/providers/b2/src/test/resources/update_bucket_request.json +++ b/providers/b2/src/test/resources/update_bucket_request.json @@ -1,5 +1,5 @@ { - "accountId": "ACCOUNT_ID", + "accountId": "YOUR_ACCOUNT_ID", "bucketId": "4a48fe8875c6214145260818", "bucketType": "allPrivate" }