From ba91165c291abbca2fed55009d48e7861e32fe06 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Mon, 14 Oct 2013 17:19:29 -0700 Subject: [PATCH] Work around CloudFiles test failures Java helpfully interprets Expect: 100-continue instead of returning the response code. This commit reverts 100afba1d8b2d1a440168fed271a7b39ab0152e7. --- .../integration/internal/BaseBlobSignerLiveTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobSignerLiveTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobSignerLiveTest.java index e1461f7059..879f8f9076 100644 --- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobSignerLiveTest.java +++ b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobSignerLiveTest.java @@ -16,6 +16,7 @@ */ package org.jclouds.blobstore.integration.internal; +import static com.google.common.net.HttpHeaders.EXPECT; import static org.jclouds.blobstore.options.GetOptions.Builder.range; import static org.testng.Assert.assertEquals; import static org.testng.Assert.fail; @@ -130,6 +131,10 @@ public class BaseBlobSignerLiveTest extends BaseBlobStoreIntegrationTest { String container = getContainerName(); try { HttpRequest request = view.getSigner().signPutBlob(container, blob, 3 /* seconds */); + // Strip Expect: 100-continue since Java 7+ will throw a + // ProtocolException instead of setting the response code: + // http://www.docjar.com/html/api/sun/net/www/protocol/http/HttpURLConnection.java.html#1021 + request = request.toBuilder().removeHeader(EXPECT).build(); assertEquals(request.getFilters().size(), 0); Strings2.toString(view.utils().http().invoke(request).getPayload());