Default domain options for newly created domain - greylisting on,
anything else not set.
This commit is contained in:
parent
cadd25346c
commit
7be61f856c
@ -1,6 +1,7 @@
|
|||||||
package de.hsadmin.mods.dom;
|
package de.hsadmin.mods.dom;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -90,6 +91,13 @@ public class DomainModuleImpl extends AbstractModuleImpl {
|
|||||||
if (admin == null || admin.getName() == null || admin.getName().length() == 0) {
|
if (admin == null || admin.getName() == null || admin.getName().length() == 0) {
|
||||||
throw new HSAdminException("domain admin required");
|
throw new HSAdminException("domain admin required");
|
||||||
}
|
}
|
||||||
|
// Standard domainoptions setzen. TODO: Alle defaults über eigene Klasse aus der Datenbank holen.
|
||||||
|
HashSet<DomainOption> domainOptions = new HashSet<DomainOption>();
|
||||||
|
DomainOption domainOption = new DomainOption();
|
||||||
|
domainOption.setName("greylisting");
|
||||||
|
domainOptions.add(domainOption);
|
||||||
|
dom.setDomainoptions(domainOptions);
|
||||||
|
|
||||||
EntityManager em = getTransaction().getEntityManager();
|
EntityManager em = getTransaction().getEntityManager();
|
||||||
|
|
||||||
UnixUser loginUser = getTransaction().getLoginUser();
|
UnixUser loginUser = getTransaction().getLoginUser();
|
||||||
|
@ -88,7 +88,7 @@ public class DomainTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreate() {
|
public void testCreate() throws UnknownHostException, IOException {
|
||||||
int count = getDomsCount();
|
int count = getDomsCount();
|
||||||
String user = "aaa00";
|
String user = "aaa00";
|
||||||
String grantingTicketURL = cas.getGrantingTicketURL(user);
|
String grantingTicketURL = cas.getGrantingTicketURL(user);
|
||||||
@ -105,6 +105,9 @@ public class DomainTest {
|
|||||||
fail(e.getMessage());
|
fail(e.getMessage());
|
||||||
}
|
}
|
||||||
assertEquals(count + 1, getDomsCount());
|
assertEquals(count + 1, getDomsCount());
|
||||||
|
// TODO die beiden folgenden Tests sind etwas spezifisch für Version 2.2
|
||||||
|
assertEquals("eine neue Domain sollte nur die Domainoption 'greylisting' haben.",1,getDomOptionsCount());
|
||||||
|
testGreylistingOnOff(true, "sollte bei neuer Domain eingeschaltet sein");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
Reference in New Issue
Block a user