@Test @SuppressWarnings("unchecked") public void testSearchEntryWithoutResults() { prepareAndInitSession(); List<String> checkedVariables = Arrays.asList("not-existing1", "not-existing2", "not-existing3", "and_so_on"); for (int i = 0; i < checkedVariables.size(); i++) { searchService.searchEntry(checkedVariables.get(i), searchCallback); verify(searchCallback, times(i + 1)).afterSearch(searchResultsCaptor.capture()); verifyNotContains(searchResultsCaptor.getValue(), new Pair<>(checkedVariables.get(i), checkedVariables.get(i))); } }
@Override public void searchEntry(String key, LiveSearchCallback<String> callback) { LiveSearchResults<String> results = new LiveSearchResults<>(); if (options.containsKey(key)) { results.add(key, options.get(key)); } callback.afterSearch(results); }
VariableSearchService implements LiveSearchService<String> { @Override public void searchEntry(String key, LiveSearchCallback<String> callback) { LiveSearchResults<String> results = new LiveSearchResults<>(); if (options.containsKey(key)) { results.add(key, options.get(key)); } callback.afterSearch(results); } }
VariableSearchService implements LiveSearchService<String> { @Override public void searchEntry(String key, LiveSearchCallback<String> callback) { LiveSearchResults<String> results = new LiveSearchResults<>(); if (options.containsKey(key)) { results.add(key, options.get(key)); } callback.afterSearch(results); } @Inject  VariableSearchService(final ConditionEditorMetadataService metadataService,
                                 final ClientTranslationService translationService); }
VariableSearchService implements LiveSearchService<String> { @Override public void searchEntry(String key, LiveSearchCallback<String> callback) { LiveSearchResults<String> results = new LiveSearchResults<>(); if (options.containsKey(key)) { results.add(key, options.get(key)); } callback.afterSearch(results); } @Inject  VariableSearchService(final ConditionEditorMetadataService metadataService,
                                 final ClientTranslationService translationService); void init(ClientSession session); @Override void search(String pattern, int maxResults, LiveSearchCallback<String> callback); @Override void searchEntry(String key, LiveSearchCallback<String> callback); String getOptionType(String key); void clear(); }
VariableSearchService implements LiveSearchService<String> { @Override public void searchEntry(String key, LiveSearchCallback<String> callback) { LiveSearchResults<String> results = new LiveSearchResults<>(); if (options.containsKey(key)) { results.add(key, options.get(key)); } callback.afterSearch(results); } @Inject  VariableSearchService(final ConditionEditorMetadataService metadataService,
                                 final ClientTranslationService translationService); void init(ClientSession session); @Override void search(String pattern, int maxResults, LiveSearchCallback<String> callback); @Override void searchEntry(String key, LiveSearchCallback<String> callback); String getOptionType(String key); void clear();  }