Work around CloudFiles test failures

Java helpfully interprets Expect: 100-continue instead of returning
the response code.  This commit reverts
100afba1d8.
This commit is contained in:
Andrew Gaul 2013-10-14 17:19:29 -07:00
parent 7a977b5eaf
commit ba91165c29
1 changed files with 5 additions and 0 deletions

View File

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