@Test public void testTranslateFilter() { when(queryRequest.getSearchText()).thenReturn(null); QueryAssembler assembler = new QueryAssembler(); Sentence gabiSentence = assembler.addPhrase(FieldType.FIRST_NAME, PhraseOperator.EQUAL, "gabi") .addPhrase(FieldType.CITY, PhraseOperator.EQUAL, "TLV") .closeSentence(SentenceOperator.AND); Sentence motySentence = assembler.addPhrase(FieldType.FIRST_NAME, PhraseOperator.EQUAL, "moty") .addPhrase(FieldType.CITY, PhraseOperator.EQUAL, "ITA") .closeSentence(SentenceOperator.AND); Sentence combinedSentence = assembler.addSentence(motySentence) .addSentence(gabiSentence) .closeSentence(SentenceOperator.OR); when(queryRequest.getSearchSentence()).thenReturn(combinedSentence); activeDirectorySearchCriteriaBuilder.translateFilter(); SearchCriteria searchCriteria = activeDirectorySearchCriteriaBuilder.get(); assertTrue(searchCriteria.getSearchFilter().equals("(|(&(givenName=moty)(l=ITA))(&(givenName=gabi)(l=TLV)))")); }
@Override public void translateFilter() { String searchTest = getQueryRequest().getSearchText(); if (searchTest != null && !searchTest.isEmpty()) { this.searchFilter = searchTest; return; } this.searchFilter = translateFilter(getQueryRequest().getSearchSentence()); }
ActiveDirectorySearchCriteriaBuilderImpl extends SearchCriteriaBuilder { @Override public void translateFilter() { String searchTest = getQueryRequest().getSearchText(); if (searchTest != null && !searchTest.isEmpty()) { this.searchFilter = searchTest; return; } this.searchFilter = translateFilter(getQueryRequest().getSearchSentence()); } }
ActiveDirectorySearchCriteriaBuilderImpl extends SearchCriteriaBuilder { @Override public void translateFilter() { String searchTest = getQueryRequest().getSearchText(); if (searchTest != null && !searchTest.isEmpty()) { this.searchFilter = searchTest; return; } this.searchFilter = translateFilter(getQueryRequest().getSearchSentence()); }  }
ActiveDirectorySearchCriteriaBuilderImpl extends SearchCriteriaBuilder { @Override public void translateFilter() { String searchTest = getQueryRequest().getSearchText(); if (searchTest != null && !searchTest.isEmpty()) { this.searchFilter = searchTest; return; } this.searchFilter = translateFilter(getQueryRequest().getSearchSentence()); }  @Override void translateFields(); @Override void translateSortKeys(); @Override void translateFilter(); @Override String translateField(FieldInfo field); @Override SearchCriteria get(); }
ActiveDirectorySearchCriteriaBuilderImpl extends SearchCriteriaBuilder { @Override public void translateFilter() { String searchTest = getQueryRequest().getSearchText(); if (searchTest != null && !searchTest.isEmpty()) { this.searchFilter = searchTest; return; } this.searchFilter = translateFilter(getQueryRequest().getSearchSentence()); }  @Override void translateFields(); @Override void translateSortKeys(); @Override void translateFilter(); @Override String translateField(FieldInfo field); @Override SearchCriteria get();  }