DefaultSearchDepthPolicy extends AbstractPolicy implements SearchDepthPolicy { public boolean continueSearch(SearchResult searchResult) { return !inputForSubSearches(searchResult).isEmpty(); }  boolean continueSearch(SearchResult searchResult); int getMaximumDepth(); @Override List<Search> inputForSubSearches(SearchResult searchResult); @Override String getDescription(); boolean levelEnabled(int level); boolean nextLevelEnabled(Request request); void setMaximumDepth(int maximumDepth); boolean isAssignedValueRequestsCanSpawnSubsearch(); void setAssignedValueRequestsCanSpawnSubsearch(boolean assignedValueRequestsCanSpawnSubsearch); @Override int hashCode(); @Override boolean equals(Object obj); static final boolean DEFAULT_ASSIGNED_VALUE_REQUESTS_CAN_SPAWN_SUBSEARCH; static final int DEFAULT_MAX_DEPTH; }
@Test public void testContinueSearch_emptySearchResult() { assertFalse(this.policy.continueSearch(fix.searchResult)); }
@Test public void testContinueSearch_levelZeroRejected() { fix.searchResult.add(new Search(fix.requestLevelZero, fix.responseReject)); assertTrue(this.policy.continueSearch(fix.searchResult)); }
@Test public void testContinueSearch_levelFourRejected() { fix.searchResult.add(new Search(fix.requestLevelFour, fix.responseReject)); assertFalse(this.policy.continueSearch(fix.searchResult)); }