]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/TestDomain.java
add: test cases for domain/email case-sensitivity #15
[gigi.git] / tests / org / cacert / gigi / TestDomain.java
index 00919975224b3cb9bd3740c624ab107008767559..91f29c7a0389daaab33e9c25be80806c69218905 100644 (file)
@@ -51,7 +51,19 @@ public class TestDomain extends ManagedTest {
         new Domain(us, us, "dub-example.org");
         try {
             new Domain(us, us, "dub-example.org");
-            fail("expected exception");
+            fail("expected exception, was able to insert domain (with different case) a second time");
+        } catch (GigiApiException e) {
+            // expected
+        }
+    }
+
+    @Test
+    public void testDoubleDomainCase() throws InterruptedException, GigiApiException {
+        Domain d = new Domain(us, us, "dub2-ExaMple.Org");
+        assertEquals("dub2-example.org", d.getSuffix());
+        try {
+            new Domain(us, us, "duB2-eXample.oRG");
+            fail("expected exception, was able to insert domain (with different case) a second time");
         } catch (GigiApiException e) {
             // expected
         }