TikaBinaryProcessor extends AbstractBinaryProcessor { @Override public Maybe<Consumer<BinaryGraphField>> process(BinaryDataProcessorContext ctx) { FileUpload upload = ctx.getUpload(); return getExtractOptions(ctx.getActionContext(), ctx.getNodeUuid(), ctx.getFieldName()) .flatMap( extractOptions -> process(extractOptions, upload), Maybe::error, () -> process(null, upload) ); } @Inject  TikaBinaryProcessor(Lazy<Vertx> vertx, MeshOptions options, Database db); @Override boolean accepts(String contentType); @Override Maybe<Consumer<BinaryGraphField>> process(BinaryDataProcessorContext ctx); TikaResult parseFile(InputStream ins, int len); TikaResult parseFile(InputStream ins, int len, boolean parseMetadata); int getParserLimit(String contentType); static String sanitizeName(String key);  }
@Test public void tikaCachingTest() throws FileNotFoundException, IOException { Lazy<Vertx> lazy = Mockito.mock(Lazy.class); when(lazy.get()).thenReturn(Vertx.vertx()); TikaBinaryProcessor processor = new TikaBinaryProcessor(lazy, new MeshOptions(), mockDb()); FileUpload ul = mockUpload("test.pdf", "application/pdf"); Maybe<Consumer<BinaryGraphField>> result = processor.process(new BinaryDataProcessorContext(null, null, null, ul, "HASHSUM")); Consumer<BinaryGraphField> consumer = result.blockingGet(); BinaryGraphField field = Mockito.mock(BinaryGraphField.class); consumer.accept(field); }