| | |
| | | |
| | | private LdapUserService ldapUserService; |
| | | |
| | | static int ldapPort = 1389; |
| | | |
| | | @BeforeClass |
| | | public static void createInMemoryLdapServer() throws Exception { |
| | | InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig("dc=MyDomain"); |
| | | config.addAdditionalBindCredentials("cn=Directory Manager", "password"); |
| | | config.setListenerConfigs(InMemoryListenerConfig.createLDAPConfig("default", 389)); |
| | | config.setListenerConfigs(InMemoryListenerConfig.createLDAPConfig("default", ldapPort)); |
| | | config.setSchema(null); |
| | | |
| | | InMemoryDirectoryServer ds = new InMemoryDirectoryServer(config); |
| | |
| | | } |
| | | |
| | | private MemorySettings getSettings() { |
| | | Map<Object, Object> backingMap = new HashMap<Object, Object>(); |
| | | backingMap.put("realm.ldap.server", "ldap://localhost:389"); |
| | | Map<String, Object> backingMap = new HashMap<String, Object>(); |
| | | backingMap.put("realm.ldap.server", "ldap://localhost:" + ldapPort); |
| | | backingMap.put("realm.ldap.domain", ""); |
| | | backingMap.put("realm.ldap.username", "cn=Directory Manager"); |
| | | backingMap.put("realm.ldap.password", "password"); |