@Test
    public void testExternalMimeTypes() throws Exception {
        System.setProperty(MimeTypesFactory.CUSTOM_MIMES_SYS_PROP,
                "src/test/resources/org/apache/tika/mime/external-mimetypes.xml");
        MimeTypes mimeTypes = MimeTypes.getDefaultMimeTypes(new CustomClassLoader());
        Metadata m = new Metadata();
        m.add(TikaCoreProperties.RESOURCE_NAME_KEY, "test.external.mime.type");
        assertEquals("external/mime-type", mimeTypes.detect(null, m).toString());
    }
TIKA-2460 Test loading of custom-mimetypes.xml from sys prop.
tika-core/src/test/java/org/apache/tika/mime/MimeTypesReaderTest.java