@Test public void testExtendedPropertiesBind() { ObjectMetadata md = ObjectMetadataBuilder.create().key("foo").cacheControl("no-cache").userMetadata( ImmutableMap.of("foo", "bar")).build(); HttpRequest request = HttpRequest.builder().method("POST").endpoint("http://localhost").build(); BindObjectMetadataToRequest binder = injector.getInstance(BindObjectMetadataToRequest.class); assertEquals(binder.bindToRequest(request, md), HttpRequest.builder().method("POST").endpoint("http://localhost").headers( ImmutableMultimap.of("Cache-Control", "no-cache", "x-amz-meta-foo", "bar", "Content-Type", "binary/octet-stream")).build()); }
@Test public void testExtendedPropertiesBind() { ObjectMetadata md = ObjectMetadataBuilder.create().key("foo").cacheControl("no-cache").userMetadata( ImmutableMap.of("foo", "bar")).build(); HttpRequest request = HttpRequest.builder().method("POST").endpoint("http://localhost").build(); BindObjectMetadataToRequest binder = injector.getInstance(BindObjectMetadataToRequest.class); assertEquals(binder.bindToRequest(request, md), HttpRequest.builder().method("POST").endpoint("http://localhost").headers( ImmutableMultimap.of("Cache-Control", "no-cache", "x-amz-meta-foo", "bar", "Content-Type", "binary/octet-stream")).build()); }