DefaultDirContextValidator implements DirContextValidator { public SearchControls getSearchControls() { return this.searchControls; } DefaultDirContextValidator();  DefaultDirContextValidator(int searchScope); String getBase(); void setBase(String base); String getFilter(); void setFilter(String filter); SearchControls getSearchControls(); void setSearchControls(SearchControls searchControls); boolean validateDirContext(DirContextType contextType, DirContext dirContext); static final String DEFAULT_FILTER; }
@Test public void testSearchScopeOneLevelScopeSetInConstructorIsUsed() throws Exception { DefaultDirContextValidator tested = new DefaultDirContextValidator(SearchControls.ONELEVEL_SCOPE); assertThat(tested.getSearchControls().getSearchScope()).as("ONELEVEL_SCOPE, ").isEqualTo(SearchControls.ONELEVEL_SCOPE); }
@Test public void testSearchScopeSubTreeScopeSetInConstructorIsUsed() throws Exception { DefaultDirContextValidator tested = new DefaultDirContextValidator(SearchControls.SUBTREE_SCOPE); assertThat(tested.getSearchControls().getSearchScope()).as("SUBTREE_SCOPE, ").isEqualTo(SearchControls.SUBTREE_SCOPE); }
@Test public void testSearchScopeObjectScopeSetInConstructorIsUsed() throws Exception { DefaultDirContextValidator tested = new DefaultDirContextValidator(SearchControls.OBJECT_SCOPE); assertThat(tested.getSearchControls().getSearchScope()).as("OBJECT_SCOPE, ").isEqualTo(SearchControls.OBJECT_SCOPE); }