TikaIO { public static Parse parse() { return new AutoValue_TikaIO_Parse.Builder().build(); }  static Parse parse(); static ParseFiles parseFiles();  }
@Test public void testParseDamagedPdfFile() throws IOException { String path = getClass().getResource("/damaged.pdf").getPath(); PCollection<ParseResult> res = p.apply("ParseInvalidPdfFile", TikaIO.parse().filepattern(path)); PAssert.thatSingleton(res) .satisfies( input -> { assertEquals(path, input.getFileLocation()); assertFalse(input.isSuccess()); assertTrue(input.getError() instanceof TikaException); return null; }); p.run(); }
@Test public void testParseDisplayData() { TikaIO.Parse parse = TikaIO.parse().filepattern("file.pdf"); DisplayData displayData = DisplayData.from(parse); assertThat(displayData, hasDisplayItem("filePattern", "file.pdf")); assertEquals(1, displayData.items().size()); }