| | |
| | | public MockEntry(DN dn, Attributes attributes) { |
| | | this.dn = dn; |
| | | this.attributes = attributes; |
| | | this.children = new LinkedList<MockEntry>(); |
| | | this.children = new LinkedList<>(); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | public MockLDAPConnection() { |
| | | this.rootEntry = new MockEntry(DN.rootDN(), new BasicAttributes()); |
| | | this.entries = new HashMap<DN, MockEntry>(); |
| | | this.entries = new HashMap<>(); |
| | | this.entries.put(DN.rootDN(), this.rootEntry); |
| | | } |
| | | |
| | |
| | | throw new NameNotFoundException("could not find entry " + dn); |
| | | } |
| | | |
| | | LinkedList<LdapName> names = new LinkedList<LdapName>(); |
| | | LinkedList<LdapName> names = new LinkedList<>(); |
| | | for (MockEntry child : entry.children) |
| | | { |
| | | names.add(new LdapName(child.getDN().toString())); |
| | |
| | | */ |
| | | protected final void assertAttributeEquals(Attribute attr, |
| | | Collection<String> values) throws NamingException { |
| | | LinkedList<String> actualValues = new LinkedList<String>(); |
| | | LinkedList<String> actualValues = new LinkedList<>(); |
| | | NamingEnumeration<?> ne = attr.getAll(); |
| | | while (ne.hasMore()) { |
| | | actualValues.add(ne.next().toString()); |