JCLOUDS-1400: Test PUT signed URL Content-Type

This commit is contained in:
Andrew Gaul 2018-04-08 23:04:51 -07:00
parent f6d47b9c0e
commit 7d40cedb20
1 changed files with 5 additions and 2 deletions

View File

@ -17,6 +17,7 @@
package org.jclouds.blobstore.integration.internal;
import static com.google.common.net.HttpHeaders.EXPECT;
import static org.assertj.core.api.Assertions.assertThat;
import static org.jclouds.blobstore.options.GetOptions.Builder.range;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
@ -130,13 +131,15 @@ public class BaseBlobSignerLiveTest extends BaseBlobStoreIntegrationTest {
String name = "hello";
String text = "fooooooooooooooooooooooo";
Blob blob = view.getBlobStore().blobBuilder(name).payload(text).contentType("text/plain").build();
Blob blob = view.getBlobStore().blobBuilder(name).payload(text).contentType("image/png").build();
String container = getContainerName();
try {
HttpRequest request = view.getSigner().signPutBlob(container, blob);
assertEquals(request.getFilters().size(), 0);
Strings2.toStringAndClose(view.utils().http().invoke(request).getPayload().openStream());
assertConsistencyAwareContainerSize(container, 1);
blob = view.getBlobStore().getBlob(container, name);
assertThat(blob.getMetadata().getContentMetadata().getContentType()).isEqualTo("image/png");
} finally {
returnContainer(container);
}