+ public void testBusinessAddWhileOtherOrg() throws IOException, GigiApiException {
+ Organisation o1 = createUniqueOrg();
+ Organisation o2 = createUniqueOrg();
+
+ String dom = createUniqueName() + ".de";
+ new Domain(u, o1, dom);
+ try {
+ new Domain(u, o2, dom);
+ fail("Was able to add domain twice.");
+ } catch (GigiApiException e) {
+ assertEquals("Domain could not be inserted. Domain is already known to the system.", e.getMessage());
+ // expected
+ }
+ assertEquals(1, o1.getDomains().length);
+ assertEquals(0, o2.getDomains().length);
+ assertEquals(0, u.getDomains().length);
+ }
+
+ private Organisation createUniqueOrg() throws GigiApiException {