@Test public void testGetFileExtensionForEmptyMimeType() throws Exception { CustomMimeTypeResolver resolver = new CustomMimeTypeResolver(); resolver.setCustomMimeTypes(new String[] {"nitf=image/nitf", "ntf=image/nitf"}); String fileExtension = resolver.getFileExtensionForMimeType(""); assertEquals(null, fileExtension); }
@Test public void testGetFileExtensionForMimeType_MultipleMappings() throws Exception { CustomMimeTypeResolver resolver = new CustomMimeTypeResolver(); resolver.setCustomMimeTypes(new String[] {"nitf=image/nitf", "ntf=image/nitf"}); String fileExtension = resolver.getFileExtensionForMimeType("image/nitf"); assertEquals(".nitf", fileExtension); }