Author: frm Date: Thu Jan 17 17:16:49 2019 New Revision: 1851551 URL: http://svn.apache.org/viewvc?rev=1851551&view=rev Log: OAK-6749 - Test that inline binaries are never downloaded
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/standby/client/RemoteBlobProcessorTest.java Modified: jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/standby/client/RemoteBlobProcessorTest.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/standby/client/RemoteBlobProcessorTest.java?rev=1851551&r1=1851550&r2=1851551&view=diff ============================================================================== --- jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/standby/client/RemoteBlobProcessorTest.java (original) +++ jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/standby/client/RemoteBlobProcessorTest.java Thu Jan 17 17:16:49 2019 @@ -101,4 +101,20 @@ public class RemoteBlobProcessorTest { processor.processBinary(store.getRoot().getProperty("b").getValue(Type.BINARY)); } + @Test + public void inlineBinaryShouldNotBeDownloaded() throws Exception { + SegmentNodeStore store = SegmentNodeStoreBuilders.builder(fileStore.fileStore()).build(); + + NodeBuilder root = store.getRoot().builder(); + root.setProperty("b", root.createBlob(new NullInputStream(SegmentTestConstants.MEDIUM_LIMIT - 1))); + store.merge(root, EmptyHook.INSTANCE, CommitInfo.EMPTY); + + RemoteBlobProcessor processor = new RemoteBlobProcessor(blobStore.blobStore(), blobId -> { + Assert.fail("Inline binaries should not be downloaded"); + return null; + }); + + processor.processBinary(store.getRoot().getProperty("b").getValue(Type.BINARY)); + } + }