@Test
    public void ensureClassLoaderUsedEverywhere() throws Exception {
        ResourceLoggingClassLoader customLoader =
                new ResourceLoggingClassLoader(getClass().getClassLoader());
        TikaConfig config;

        // Without a classloader set, normal one will be used
        config = new TikaConfig();
        config.getMediaTypeRegistry();
        config.getParser();
        assertEquals(0, customLoader.getLoadedResources().size());

        // With a classloader set, resources will come through it
        config = new TikaConfig(customLoader);
        config.getMediaTypeRegistry();
        config.getParser();

        Map<String, List<URL>> resources = customLoader.getLoadedResources();
        int resourcesCount = resources.size();
        assertTrue(resourcesCount > 3,
                "Not enough things used the classloader, found only " + resourcesCount);

        // Ensure everything that should do, did use it
        // - Parsers
        assertNotNull(resources.get("META-INF/services/org.apache.tika.parser.Parser"));
        // - Detectors
        //assertNotNull(resources.get("META-INF/services/org.apache.tika.detect.Detector"));
        // - Built-In Mimetypes
        assertNotNull(resources.get("org/apache/tika/mime/tika-mimetypes.xml"));
        // - Custom Mimetypes
        assertNotNull(resources.get("custom-mimetypes.xml"));
    }
TIKA-1145 If the TikaConfig has a ClassLoader set on it,
that should be used when loading the mimetypes and when
discovering services
tika-core/src/test/java/org/apache/tika/config/TikaConfigTest.java