agangam commented on code in PR #5:
URL: 
https://github.com/apache/sling-org-apache-sling-commons-mime/pull/5#discussion_r1008390217


##########
src/test/java/org/apache/sling/commons/mime/internal/MimeTypeServiceImplTest.java:
##########
@@ -152,6 +165,29 @@ public void testProvider2() throws Exception {
         assertNull(this.service.getMimeType(GIF));
     }
 
+    public void testMultipleMimeTypes() throws Exception {
+        loadMimeTypes(MimeTypeServiceImpl.CORE_MIME_TYPES);
+        loadMimeTypes(MimeTypeServiceImpl.MIME_TYPES);
+
+        for (String mm : epsMimeTypeExt.keySet()) {
+            assertEquals("Extension " + mm + " (1)", epsMimeTypeExt.get(mm), 
this.service.getExtension(mm));
+        }
+    }
+
+    public void testNegativeTests() throws Exception {
+        loadMimeTypes(MimeTypeServiceImpl.CORE_MIME_TYPES);
+        loadMimeTypes(MimeTypeServiceImpl.MIME_TYPES);
+
+        // null
+        String mm = null;
+        assertEquals("Extension " + mm, mm, this.service.getExtension(mm));
+        this.service.registerMimeType("application/invalid-1", mm);
+        mm = "";
+        assertEquals("Extension " + mm, null, this.service.getExtension(mm));
+        this.service.registerMimeType("application/invalid-1", mm);

Review Comment:
   They are negative tests with invalid values registered. Simplified the tests.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to