@Override protected void before() throws Throwable { String connectionPropsLocation = getConnectionPropertiesLocation(); ldapTestConfiguration = LDAPTestConfiguration.readConfiguration(connectionPropsLocation); if (ldapTestConfiguration.isStartEmbeddedLdapLerver()) { ldapEmbeddedServer = createServer(); ldapEmbeddedServer.init(); ldapEmbeddedServer.start(); } }
@Override protected void after() { try { if (ldapEmbeddedServer != null) { ldapEmbeddedServer.stop(); ldapEmbeddedServer = null; ldapTestConfiguration = null; } } catch (Exception e) { throw new RuntimeException("Error tearDown Embedded LDAP server.", e); } }