From b186220ff775e458e8e8c744004895b316feba6f Mon Sep 17 00:00:00 2001 From: adriancole Date: Sun, 3 Mar 2013 17:23:09 -0800 Subject: [PATCH] atmos: explicitly set Expect header on methods that need it --- .../src/main/java/org/jclouds/atmos/AtmosAsyncClient.java | 5 +++++ .../test/java/org/jclouds/atmos/AtmosAsyncClientTest.java | 8 ++++---- .../atmos/blobstore/AtmosBlobRequestSignerTest.java | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/apis/atmos/src/main/java/org/jclouds/atmos/AtmosAsyncClient.java b/apis/atmos/src/main/java/org/jclouds/atmos/AtmosAsyncClient.java index dc67cb5d48..5abf2f07a2 100644 --- a/apis/atmos/src/main/java/org/jclouds/atmos/AtmosAsyncClient.java +++ b/apis/atmos/src/main/java/org/jclouds/atmos/AtmosAsyncClient.java @@ -18,6 +18,8 @@ */ package org.jclouds.atmos; +import static com.google.common.net.HttpHeaders.EXPECT; + import java.net.URI; import javax.inject.Named; @@ -56,6 +58,7 @@ import org.jclouds.blobstore.BlobStoreFallbacks.ThrowKeyNotFoundOn404; import org.jclouds.http.options.GetOptions; import org.jclouds.rest.annotations.BinderParam; import org.jclouds.rest.annotations.Fallback; +import org.jclouds.rest.annotations.Headers; import org.jclouds.rest.annotations.ParamParser; import org.jclouds.rest.annotations.QueryParams; import org.jclouds.rest.annotations.RequestFilters; @@ -119,6 +122,7 @@ public interface AtmosAsyncClient { @Named("CreateObject") @POST @Path("/{parent}/{name}") + @Headers(keys = EXPECT, values = "100-continue") @Consumes(MediaType.WILDCARD) ListenableFuture createFile( @PathParam("parent") String parent, @@ -131,6 +135,7 @@ public interface AtmosAsyncClient { @Named("UpdateObject") @PUT @Path("/{parent}/{name}") + @Headers(keys = EXPECT, values = "100-continue") @Fallback(ThrowKeyNotFoundOn404.class) @Consumes(MediaType.WILDCARD) ListenableFuture updateFile( diff --git a/apis/atmos/src/test/java/org/jclouds/atmos/AtmosAsyncClientTest.java b/apis/atmos/src/test/java/org/jclouds/atmos/AtmosAsyncClientTest.java index e82844aeec..d26edd8a4b 100644 --- a/apis/atmos/src/test/java/org/jclouds/atmos/AtmosAsyncClientTest.java +++ b/apis/atmos/src/test/java/org/jclouds/atmos/AtmosAsyncClientTest.java @@ -167,7 +167,7 @@ public class AtmosAsyncClientTest extends BaseAsyncClientTest .apply(BindBlobToMultipartFormTest.TEST_BLOB))); assertRequestLineEquals(request, "POST https://accesspoint.atmosonline.com/rest/namespace/dir/hello HTTP/1.1"); - assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT + ": */*\n"); + assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT + ": */*\nExpect: 100-continue\n"); assertPayloadEquals(request, "hello", "text/plain", false); assertResponseParserClassEquals(method, request, ParseURIFromListOrLocationHeaderIf20x.class); @@ -185,7 +185,7 @@ public class AtmosAsyncClientTest extends BaseAsyncClientTest assertRequestLineEquals(request, "POST https://accesspoint.atmosonline.com/rest/namespace/dir/hello HTTP/1.1"); assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT - + ": */*\nx-emc-groupacl: other=READ\nx-emc-useracl: root=FULL_CONTROL\n"); + + ": */*\nExpect: 100-continue\nx-emc-groupacl: other=READ\nx-emc-useracl: root=FULL_CONTROL\n"); assertPayloadEquals(request, "hello", "text/plain", false); assertResponseParserClassEquals(method, request, ParseURIFromListOrLocationHeaderIf20x.class); @@ -202,7 +202,7 @@ public class AtmosAsyncClientTest extends BaseAsyncClientTest .apply(BindBlobToMultipartFormTest.TEST_BLOB))); assertRequestLineEquals(request, "PUT https://accesspoint.atmosonline.com/rest/namespace/dir/hello HTTP/1.1"); - assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT + ": */*\n"); + assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT + ": */*\nExpect: 100-continue\n"); assertPayloadEquals(request, "hello", "text/plain", false); assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class); @@ -220,7 +220,7 @@ public class AtmosAsyncClientTest extends BaseAsyncClientTest assertRequestLineEquals(request, "PUT https://accesspoint.atmosonline.com/rest/namespace/dir/hello HTTP/1.1"); assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT - + ": */*\nx-emc-groupacl: other=READ\nx-emc-useracl: root=FULL_CONTROL\n"); + + ": */*\nExpect: 100-continue\nx-emc-groupacl: other=READ\nx-emc-useracl: root=FULL_CONTROL\n"); assertPayloadEquals(request, "hello", "text/plain", false); assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class); diff --git a/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/AtmosBlobRequestSignerTest.java b/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/AtmosBlobRequestSignerTest.java index 0b063bdc8d..bfad46d922 100644 --- a/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/AtmosBlobRequestSignerTest.java +++ b/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/AtmosBlobRequestSignerTest.java @@ -101,7 +101,7 @@ public class AtmosBlobRequestSignerTest extends BaseAsyncClientTest