@Test
    public void testEmbedded() throws Exception {
        assumeTrue(ExternalParser.check("unrar"));

        // Expected embedded resources in test-documents.rar file.
        String[] expectedResources = { "testHTML.html", "testEXCEL.xls", "testOpenOffice2.odt", "testPDF.pdf",
                "testPPT.ppt", "testRTF.rtf", "testTXT.txt", "testWORD.doc", "testXML.xml"};

        TikaConfig tikaConfig = null;
        try (InputStream is = getResourceAsStream("tika-unrar-config.xml")) {
            tikaConfig = new TikaConfig(is);
        }
        Parser p = new AutoDetectParser(tikaConfig);
        List<Metadata> metadataList = getRecursiveMetadata("test-documents.rar", p);
        assertEquals("org.apache.tika.parser.pkg.UnrarParser",
                metadataList.get(0).getValues(TikaCoreProperties.TIKA_PARSED_BY)[1]);
        assertEquals(12, metadataList.size());

        for (String resource : expectedResources) {
            assertEquals(1, metadataList.stream()
                    .filter(m -> m.get(TikaCoreProperties.ORIGINAL_RESOURCE_NAME) != null &&
                            m.get(TikaCoreProperties.ORIGINAL_RESOURCE_NAME).contains(resource)).count());
        }
    }
Tests that the ParseContext parser is correctly
fired for all the embedded entries.
tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/parser/pkg/UnrarParserTest.java