Attempting to fire-up an AD-like server for verifying ldap queries for 'user' entities.
The test:
import org.zapodot.junit.ldap.EmbeddedLdapRule
import org.zapodot.junit.ldap.EmbeddedLdapRuleBuilder
class FooSpec extends Specification {
@Rule
public EmbeddedLdapRule embeddedLdapRule = EmbeddedLdapRuleBuilder
.newInstance()
.withSchema('schema.ldif')
.importingLdifs('import.ldif')
//...
}
schema.ldif:
dn: cn=user,cn=schema,cn=configuration,dc=example,dc=com
changetype: add
objectclass: classSchema
governsId: 1.2.840.113556.1.5.9
objectClassCategory: 1
subClassOf: organizationalPerson
lDAPDisplayName: user
description: a user
import.ldif:
dn: CN=alice,DC=example,dc=com
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: user
cn: alice
sn: alice
Getting:
Unable to add entry 'CN=alice,DC=example,dc=com' because it violates the provided schema: The entry contains object class user which is not defined in the schema.
What am I doing wrong?
Thanks!