throw new InvalidRecordFormatException("Record [dn: " + record.getDN() + "] does not conform to specification.");
throw new InvalidRecordFormatException("Record [dn: " + record.getDN() + "] does not conform to specification.");
throw new InvalidRecordFormatException("Record [dn: " + record.getDN() + "] does not conform to specification.");
sb.append("dn:: " + LdapEncoder.printBase64Binary(dn.toString().getBytes()) + "\n"); } else { sb.append("dn: " + getDN() + "\n");
sb.append("dn:: " + LdapEncoder.printBase64Binary(dn.toString().getBytes()) + "\n"); } else { sb.append("dn: " + getDN() + "\n");
sb.append("dn:: " + LdapEncoder.printBase64Binary(dn.toString().getBytes()) + "\n"); } else { sb.append("dn: " + getDN() + "\n");
log.info("attributes:\n" + attributes); if (attributes != null) { assertThat(attributes.getDN() != null).isTrue(); assertThat(attributes.get("objectclass") != null).isTrue(); count++;
private static void loadLdif(DirContext context, Resource ldifFile) throws IOException { try { DistinguishedName baseDn = (DistinguishedName) context.getEnvironment() .get(DefaultDirObjectFactory.JNDI_ENV_BASE_PATH_KEY); LdifParser parser = new LdifParser(ldifFile); parser.open(); while (parser.hasMoreRecords()) { LdapAttributes record = parser.getRecord(); DistinguishedName dn = record.getDN(); if (baseDn != null) { dn.removeFirst(baseDn); } context.bind(dn, null, record); } } catch (NamingException e) { throw new RuntimeException("Failed to populate LDIF", e); } }