@Provides AtmosObject provideAtmosObject(AtmosObject.Factory factory) { return factory.create((MutableContentMetadata) null); }
@Provides final AtmosObject provideAtmosObject(AtmosObject.Factory factory) { return factory.create((MutableContentMetadata) null); }
@Provides AtmosObject provideAtmosObject(AtmosObject.Factory factory) { return factory.create((MutableContentMetadata) null); }
@Test public void testCorrectSystemMetadataObjectName() throws SecurityException, NoSuchMethodException { AtmosObject blob = BLOB_FACTORY.create(new SystemMetadata(null, null, null, null, null, null, 0, null, "foo", null, 0, null, null), new UserMetadata()); assertEquals(fn.apply(blob), "foo"); }
public AtmosObject apply(BlobMetadata from) { if (from == null) return null; UserMetadata userMd = new UserMetadata(); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) userMd.getMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } return factory.create(blob2ContentMd.apply(from), blob2SysMd.apply(from), userMd); }
@Test(expectedExceptions = NullPointerException.class) public void testNullPayloadIsBad() { AtmosObject object = injector.getInstance(AtmosObject.Factory.class).create(null); HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://localhost").build(); binder.bindToRequest(request, object); }
public AtmosObject apply(BlobMetadata from) { if (from == null) return null; UserMetadata userMd = new UserMetadata(); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) userMd.getMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } return factory.create(blob2ContentMd.apply(from), blob2SysMd.apply(from), userMd); }
public AtmosObject apply(BlobMetadata from) { if (from == null) return null; UserMetadata userMd = new UserMetadata(); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) userMd.getMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } return factory.create(blob2ContentMd.apply(from), blob2SysMd.apply(from), userMd); }
@Override public AtmosObject newObject() { return this.objectProvider.create(null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullContentLengthIllegal() { AtmosObject object = injector.getInstance(AtmosObject.Factory.class).create(null); Payload payload = Payloads.newStringPayload(""); payload.getContentMetadata().setContentLength(null); object.setPayload(payload); HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://localhost").build(); binder.bindToRequest(request, object); }
public void testGood() { AtmosObject object = injector.getInstance(AtmosObject.Factory.class).create(null); Payload payload = Payloads.newStringPayload(""); object.setPayload(payload); object.getUserMetadata().getListableMetadata().put("apple", "bear"); object.getUserMetadata().getListableMetadata().put("sushi", "king"); HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://localhost").build(); request = binder.bindToRequest(request, object); assertEquals(request.getFirstHeaderOrNull("x-emc-listable-meta"), "apple=bear,sushi=king"); }
public AtmosObject apply(BlobMetadata from) { if (from == null) return null; UserMetadata userMd = new UserMetadata(); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) userMd.getMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } return factory.create(blob2ContentMd.apply(from), blob2SysMd.apply(from), userMd); }
public AtmosObject apply(BlobMetadata from) { if (from == null) return null; UserMetadata userMd = new UserMetadata(); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) userMd.getMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } return factory.create(blob2ContentMd.apply(from), blob2SysMd.apply(from), userMd); }
public AtmosObject apply(BlobMetadata from) { if (from == null) return null; UserMetadata userMd = new UserMetadata(); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) userMd.getMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } return factory.create(blob2ContentMd.apply(from), blob2SysMd.apply(from), userMd); }
@Test public void testCorrectSystemMetadataObjectName() throws SecurityException, NoSuchMethodException { AtmosObject blob = BLOB_FACTORY.create(new SystemMetadata(null, null, null, null, null, null, 0, null, "foo", null, 0, null, null), new UserMetadata()); assertEquals(fn.apply(blob), "foo"); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullContentLengthIllegal() { AtmosObject object = injector.getInstance(AtmosObject.Factory.class).create(null); Payload payload = Payloads.newStringPayload(""); payload.getContentMetadata().setContentLength(null); object.setPayload(payload); HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://localhost").build(); binder.bindToRequest(request, object); }
public void testGood() { AtmosObject object = injector.getInstance(AtmosObject.Factory.class).create(null); Payload payload = Payloads.newStringPayload(""); object.setPayload(payload); object.getUserMetadata().getListableMetadata().put("apple", "bear"); object.getUserMetadata().getListableMetadata().put("sushi", "king"); HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://localhost").build(); request = binder.bindToRequest(request, object); assertEquals(request.getFirstHeaderOrNull("x-emc-listable-meta"), "apple=bear,sushi=king"); }
public AtmosObject apply(BlobMetadata from) { if (from == null) return null; UserMetadata userMd = new UserMetadata(); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) userMd.getMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } return factory.create(blob2ContentMd.apply(from), blob2SysMd.apply(from), userMd); }
@Test public void testCorrectContentMetadataName() throws SecurityException, NoSuchMethodException { AtmosObject blob = BLOB_FACTORY.create(null); blob.getContentMetadata().setName("foo"); assertEquals(fn.apply(blob), "foo"); }
@Test(expectedExceptions = NullPointerException.class) public void testNullPayloadIsBad() { AtmosObject object = injector.getInstance(AtmosObject.Factory.class).create(null); HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://localhost").build(); binder.bindToRequest(request, object); }