DirContextAdapter implements DirContextOperations { @Override public Name getDn() { return LdapUtils.newLdapName(dn); } DirContextAdapter();  DirContextAdapter(String dnString);  DirContextAdapter(Name dn);  DirContextAdapter(Attributes attrs, Name dn);  DirContextAdapter(Attributes attrs, Name dn, Name base);  DirContextAdapter(Attributes attrs, Name dn, Name base,
			String referralUrl); protected  DirContextAdapter(DirContextAdapter master); void setUpdateMode(boolean mode); @Override boolean isUpdateMode(); @Override String[] getNamesOfModifiedAttributes(); @Override ModificationItem[] getModificationItems(); @Override String getStringAttribute(String name); @Override Object getObjectAttribute(String name); @Override // LDAP-215 boolean attributeExists(String name); @Override void setAttributeValue(String name, Object value); @Override void addAttributeValue(String name, Object value); @Override void addAttributeValue(String name, Object value,
			boolean addIfDuplicateExists); @Override void removeAttributeValue(String name, Object value); @Override void setAttributeValues(String name, Object[] values); @Override void setAttributeValues(String name, Object[] values,
			boolean orderMatters); @Override void update(); @Override String[] getStringAttributes(String name); @Override Object[] getObjectAttributes(String name); @Override SortedSet<String> getAttributeSortedStringSet(String name); void setAttribute(Attribute attribute); Attributes getAttributes(); @Override Attributes getAttributes(Name name); @Override Attributes getAttributes(String name); @Override Attributes getAttributes(Name name, String[] attrIds); @Override Attributes getAttributes(String name, String[] attrIds); @Override void modifyAttributes(Name name, int modOp, Attributes attrs); @Override void modifyAttributes(String name, int modOp, Attributes attrs); @Override void modifyAttributes(Name name, ModificationItem[] mods); @Override void modifyAttributes(String name, ModificationItem[] mods); @Override void bind(Name name, Object obj, Attributes attrs); @Override void bind(String name, Object obj, Attributes attrs); @Override void rebind(Name name, Object obj, Attributes attrs); @Override void rebind(String name, Object obj, Attributes attrs); @Override DirContext createSubcontext(Name name, Attributes attrs); @Override DirContext createSubcontext(String name, Attributes attrs); @Override DirContext getSchema(Name name); @Override DirContext getSchema(String name); @Override DirContext getSchemaClassDefinition(Name name); @Override DirContext getSchemaClassDefinition(String name); @Override NamingEnumeration<SearchResult> search(Name name, Attributes matchingAttributes,
			String[] attributesToReturn); @Override NamingEnumeration<SearchResult> search(String name, Attributes matchingAttributes,
			String[] attributesToReturn); @Override NamingEnumeration<SearchResult> search(Name name, Attributes matchingAttributes); @Override NamingEnumeration<SearchResult> search(String name, Attributes matchingAttributes); @Override NamingEnumeration<SearchResult> search(Name name, String filter,
			SearchControls cons); @Override NamingEnumeration<SearchResult> search(String name, String filter,
			SearchControls cons); @Override NamingEnumeration<SearchResult> search(Name name, String filterExpr,
			Object[] filterArgs, SearchControls cons); @Override NamingEnumeration<SearchResult> search(String name, String filterExpr,
			Object[] filterArgs, SearchControls cons); @Override Object lookup(Name name); @Override Object lookup(String name); @Override void bind(Name name, Object obj); @Override void bind(String name, Object obj); @Override void rebind(Name name, Object obj); @Override void rebind(String name, Object obj); @Override void unbind(Name name); @Override void unbind(String name); @Override void rename(Name oldName, Name newName); @Override void rename(String oldName, String newName); @Override NamingEnumeration<NameClassPair> list(Name name); @Override NamingEnumeration<NameClassPair> list(String name); @Override NamingEnumeration<Binding> listBindings(Name name); @Override NamingEnumeration<Binding> listBindings(String name); @Override void destroySubcontext(Name name); @Override void destroySubcontext(String name); @Override Context createSubcontext(Name name); @Override Context createSubcontext(String name); @Override Object lookupLink(Name name); @Override Object lookupLink(String name); @Override NameParser getNameParser(Name name); @Override NameParser getNameParser(String name); @Override Name composeName(Name name, Name prefix); @Override String composeName(String name, String prefix); @Override Object addToEnvironment(String propName, Object propVal); @Override Object removeFromEnvironment(String propName); @Override Hashtable<?, ?> getEnvironment(); @Override void close(); @Override String getNameInNamespace(); @Override Name getDn(); @Override final void setDn(Name dn); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override String getReferralUrl(); @Override boolean isReferral();  }
@Test public void testGetDn() throws Exception { DirContextAdapter tested = new DirContextAdapter(DUMMY_NAME); Name result = tested.getDn(); assertThat(result).isEqualTo(DUMMY_NAME); }
@Test public void testGetDn_BasePath() { DirContextAdapter tested = new DirContextAdapter(null, DUMMY_NAME, BASE_NAME); Name result = tested.getDn(); assertThat(result).isEqualTo(DUMMY_NAME); }
@Test public void testStringConstructor() { DirContextAdapter tested = new DirContextAdapter("cn=john doe, ou=company"); assertThat(tested.getDn()).isEqualTo(LdapUtils.newLdapName("cn=john doe, ou=company")); }