@Test public void checkEmptyDefinition() { final Callback<Map<String, String>> callback = (result) -> assertTrue(result.isEmpty()); enumLoaderUtilities.getEnums(new DropDownData(), callback, presenter, onFetchCommand, onFetchCompleteCommand); assertNoInteractions(); }
public void getEnums(final DropDownData enumDefinition, final Callback<Map<String, String>> callback, final GuidedDecisionTablePresenter presenter, final Command onFetchCommand, final Command onFetchCompleteCommand) { if (enumDefinition == null) { callback.callback(Collections.<String, String>emptyMap()); return; } if (enumDefinition.getFixedList() != null) { getEnumsFromFixedList(enumDefinition, callback); return; } if (enumDefinition.getQueryExpression() != null) { getEnumsFromServer(enumDefinition, callback, presenter, onFetchCommand, onFetchCompleteCommand); return; } callback.callback(Collections.<String, String>emptyMap()); }
EnumLoaderUtilities { public void getEnums(final DropDownData enumDefinition, final Callback<Map<String, String>> callback, final GuidedDecisionTablePresenter presenter, final Command onFetchCommand, final Command onFetchCompleteCommand) { if (enumDefinition == null) { callback.callback(Collections.<String, String>emptyMap()); return; } if (enumDefinition.getFixedList() != null) { getEnumsFromFixedList(enumDefinition, callback); return; } if (enumDefinition.getQueryExpression() != null) { getEnumsFromServer(enumDefinition, callback, presenter, onFetchCommand, onFetchCompleteCommand); return; } callback.callback(Collections.<String, String>emptyMap()); } }
EnumLoaderUtilities { public void getEnums(final DropDownData enumDefinition, final Callback<Map<String, String>> callback, final GuidedDecisionTablePresenter presenter, final Command onFetchCommand, final Command onFetchCompleteCommand) { if (enumDefinition == null) { callback.callback(Collections.<String, String>emptyMap()); return; } if (enumDefinition.getFixedList() != null) { getEnumsFromFixedList(enumDefinition, callback); return; } if (enumDefinition.getQueryExpression() != null) { getEnumsFromServer(enumDefinition, callback, presenter, onFetchCommand, onFetchCompleteCommand); return; } callback.callback(Collections.<String, String>emptyMap()); } @Inject  EnumLoaderUtilities(final Caller<EnumDropdownService> enumDropdownService); }
EnumLoaderUtilities { public void getEnums(final DropDownData enumDefinition, final Callback<Map<String, String>> callback, final GuidedDecisionTablePresenter presenter, final Command onFetchCommand, final Command onFetchCompleteCommand) { if (enumDefinition == null) { callback.callback(Collections.<String, String>emptyMap()); return; } if (enumDefinition.getFixedList() != null) { getEnumsFromFixedList(enumDefinition, callback); return; } if (enumDefinition.getQueryExpression() != null) { getEnumsFromServer(enumDefinition, callback, presenter, onFetchCommand, onFetchCompleteCommand); return; } callback.callback(Collections.<String, String>emptyMap()); } @Inject  EnumLoaderUtilities(final Caller<EnumDropdownService> enumDropdownService); void getEnums(final DropDownData enumDefinition,
                         final Callback<Map<String, String>> callback,
                         final GuidedDecisionTablePresenter presenter,
                         final Command onFetchCommand,
                         final Command onFetchCompleteCommand); Map<String, String> convertDropDownData(final String[] dropDownItems); }
EnumLoaderUtilities { public void getEnums(final DropDownData enumDefinition, final Callback<Map<String, String>> callback, final GuidedDecisionTablePresenter presenter, final Command onFetchCommand, final Command onFetchCompleteCommand) { if (enumDefinition == null) { callback.callback(Collections.<String, String>emptyMap()); return; } if (enumDefinition.getFixedList() != null) { getEnumsFromFixedList(enumDefinition, callback); return; } if (enumDefinition.getQueryExpression() != null) { getEnumsFromServer(enumDefinition, callback, presenter, onFetchCommand, onFetchCompleteCommand); return; } callback.callback(Collections.<String, String>emptyMap()); } @Inject  EnumLoaderUtilities(final Caller<EnumDropdownService> enumDropdownService); void getEnums(final DropDownData enumDefinition,
                         final Callback<Map<String, String>> callback,
                         final GuidedDecisionTablePresenter presenter,
                         final Command onFetchCommand,
                         final Command onFetchCompleteCommand); Map<String, String> convertDropDownData(final String[] dropDownItems);  }