private void testExtract(String targetFile, String[] expectedChildrenFileNames, int expectedLength) throws Exception {

        String[] params = {"--extract-dir=" + ProcessUtils.escapeCommandLine(extractDir
                .toAbsolutePath()
                .toString()), "-z", resourcePrefix + "/" + targetFile};

        TikaCLI.main(params);

        String[] tempFileNames = extractDir
                .toFile()
                .list();
        assertNotNull(tempFileNames);
        assertEquals(expectedLength, tempFileNames.length);
        String allFiles = String.join(" : ", tempFileNames);

        for (String expectedChildName : expectedChildrenFileNames) {
            assertExtracted(extractDir.resolve(expectedChildName), allFiles);
        }
    }
Tests --list-supported-types option of the cli

@throws Exception
tika-app/src/test/java/org/apache/tika/cli/TikaCLITest.java