@Test(expected = ObjectManagerException.class) public void supplierException() { when(this.objectManager.removeForUpdate()).thenThrow(new ObjectManagerException()); new ObjectRetentionExtensionFunction(this.objectManager).apply(Maps.<String, String>newHashMap()); }
@Override public String apply(final Map<String, String> context) { final ObjectMetadata objectMetadata = this.objectManager.removeForUpdate(); context.put(Context.X_OG_OBJECT_NAME, objectMetadata.getName()); context.put(Context.X_OG_OBJECT_SIZE, String.valueOf(objectMetadata.getSize())); context.put(Context.X_OG_CONTAINER_SUFFIX, String.valueOf(objectMetadata.getContainerSuffix())); context.put(Context.X_OG_LEGAL_HOLD_SUFFIX, String.valueOf(objectMetadata.getNumberOfLegalHolds())); context.put(Context.X_OG_OBJECT_RETENTION, String.valueOf(objectMetadata.getRetention())); return objectMetadata.getName(); }
ObjectRetentionExtensionFunction implements Function<Map<String, String>, String> { @Override public String apply(final Map<String, String> context) { final ObjectMetadata objectMetadata = this.objectManager.removeForUpdate(); context.put(Context.X_OG_OBJECT_NAME, objectMetadata.getName()); context.put(Context.X_OG_OBJECT_SIZE, String.valueOf(objectMetadata.getSize())); context.put(Context.X_OG_CONTAINER_SUFFIX, String.valueOf(objectMetadata.getContainerSuffix())); context.put(Context.X_OG_LEGAL_HOLD_SUFFIX, String.valueOf(objectMetadata.getNumberOfLegalHolds())); context.put(Context.X_OG_OBJECT_RETENTION, String.valueOf(objectMetadata.getRetention())); return objectMetadata.getName(); } }
ObjectRetentionExtensionFunction implements Function<Map<String, String>, String> { @Override public String apply(final Map<String, String> context) { final ObjectMetadata objectMetadata = this.objectManager.removeForUpdate(); context.put(Context.X_OG_OBJECT_NAME, objectMetadata.getName()); context.put(Context.X_OG_OBJECT_SIZE, String.valueOf(objectMetadata.getSize())); context.put(Context.X_OG_CONTAINER_SUFFIX, String.valueOf(objectMetadata.getContainerSuffix())); context.put(Context.X_OG_LEGAL_HOLD_SUFFIX, String.valueOf(objectMetadata.getNumberOfLegalHolds())); context.put(Context.X_OG_OBJECT_RETENTION, String.valueOf(objectMetadata.getRetention())); return objectMetadata.getName(); } ObjectRetentionExtensionFunction(final ObjectManager objectManager); }
ObjectRetentionExtensionFunction implements Function<Map<String, String>, String> { @Override public String apply(final Map<String, String> context) { final ObjectMetadata objectMetadata = this.objectManager.removeForUpdate(); context.put(Context.X_OG_OBJECT_NAME, objectMetadata.getName()); context.put(Context.X_OG_OBJECT_SIZE, String.valueOf(objectMetadata.getSize())); context.put(Context.X_OG_CONTAINER_SUFFIX, String.valueOf(objectMetadata.getContainerSuffix())); context.put(Context.X_OG_LEGAL_HOLD_SUFFIX, String.valueOf(objectMetadata.getNumberOfLegalHolds())); context.put(Context.X_OG_OBJECT_RETENTION, String.valueOf(objectMetadata.getRetention())); return objectMetadata.getName(); } ObjectRetentionExtensionFunction(final ObjectManager objectManager); @Override String apply(final Map<String, String> context); @Override String toString(); }
ObjectRetentionExtensionFunction implements Function<Map<String, String>, String> { @Override public String apply(final Map<String, String> context) { final ObjectMetadata objectMetadata = this.objectManager.removeForUpdate(); context.put(Context.X_OG_OBJECT_NAME, objectMetadata.getName()); context.put(Context.X_OG_OBJECT_SIZE, String.valueOf(objectMetadata.getSize())); context.put(Context.X_OG_CONTAINER_SUFFIX, String.valueOf(objectMetadata.getContainerSuffix())); context.put(Context.X_OG_LEGAL_HOLD_SUFFIX, String.valueOf(objectMetadata.getNumberOfLegalHolds())); context.put(Context.X_OG_OBJECT_RETENTION, String.valueOf(objectMetadata.getRetention())); return objectMetadata.getName(); } ObjectRetentionExtensionFunction(final ObjectManager objectManager); @Override String apply(final Map<String, String> context); @Override String toString();  }