@Test public void testReload() { searchService.init(clientSession); FunctionDef someFunction = searchService.getFunction(FUNCTION1); assertNull(someFunction); prepareForLoad(); searchService.reload(TYPE, command); ArgumentCaptor<ConditionEditorAvailableFunctionsService.Input> inputArgumentCaptor = ArgumentCaptor.forClass(ConditionEditorAvailableFunctionsService.Input.class); verify(availableFunctionsService).call(inputArgumentCaptor.capture()); assertEquals(path, inputArgumentCaptor.getValue().path); assertEquals(TYPE, inputArgumentCaptor.getValue().clazz); someFunction = searchService.getFunction(FUNCTION1); assertNotNull(someFunction); assertEquals(testFunctions.get(0), someFunction); verify(command).execute(); }
public void reload(final String type, final Command onSuccess) { availableFunctionsService .call(new ConditionEditorAvailableFunctionsService.Input(path, type)) .then(result -> { setFunctions(result); onSuccess.execute(); return null; }); }
FunctionSearchService implements LiveSearchService<String> { public void reload(final String type, final Command onSuccess) { availableFunctionsService .call(new ConditionEditorAvailableFunctionsService.Input(path, type)) .then(result -> { setFunctions(result); onSuccess.execute(); return null; }); } }
FunctionSearchService implements LiveSearchService<String> { public void reload(final String type, final Command onSuccess) { availableFunctionsService .call(new ConditionEditorAvailableFunctionsService.Input(path, type)) .then(result -> { setFunctions(result); onSuccess.execute(); return null; }); } @Inject  FunctionSearchService(final ConditionEditorAvailableFunctionsService availableFunctionsService,
                                 final FunctionNamingService functionNamingService); }
FunctionSearchService implements LiveSearchService<String> { public void reload(final String type, final Command onSuccess) { availableFunctionsService .call(new ConditionEditorAvailableFunctionsService.Input(path, type)) .then(result -> { setFunctions(result); onSuccess.execute(); return null; }); } @Inject  FunctionSearchService(final ConditionEditorAvailableFunctionsService availableFunctionsService,
                                 final FunctionNamingService functionNamingService); void init(final ClientSession session); void reload(final String type,
                       final Command onSuccess); void clear(); @Override void search(final String pattern,
                       final int maxResults,
                       final LiveSearchCallback<String> callback); @Override void searchEntry(final String key,
                            final LiveSearchCallback<String> callback); FunctionDef getFunction(final String function); }
FunctionSearchService implements LiveSearchService<String> { public void reload(final String type, final Command onSuccess) { availableFunctionsService .call(new ConditionEditorAvailableFunctionsService.Input(path, type)) .then(result -> { setFunctions(result); onSuccess.execute(); return null; }); } @Inject  FunctionSearchService(final ConditionEditorAvailableFunctionsService availableFunctionsService,
                                 final FunctionNamingService functionNamingService); void init(final ClientSession session); void reload(final String type,
                       final Command onSuccess); void clear(); @Override void search(final String pattern,
                       final int maxResults,
                       final LiveSearchCallback<String> callback); @Override void searchEntry(final String key,
                            final LiveSearchCallback<String> callback); FunctionDef getFunction(final String function);  }