@Test
public void testOCRAutoMode() throws Exception {

    assumeTrue("can run OCR", canRunOCR());
    PDFParserConfig config = new PDFParserConfig();
    config.setOcrStrategy(PDFParserConfig.OCR_STRATEGY.AUTO);
    ParseContext context = new ParseContext();
    context.set(PDFParserConfig.class, config);
    XMLResult xmlResult = getXML("testOCR.pdf", context);
    assertContains("Happy New Year", xmlResult.xml);
    config.setOcrStrategy(PDFParserConfig.OCR_STRATEGY.NO_OCR);
    String txt = getText("testOCR.pdf", new Metadata(), context);
    assertEquals("", txt.trim());
}