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);  }
@Test public void checkNullDefinition() { final Callback<Map<String, String>> callback = (result) -> assertTrue(result.isEmpty()); enumLoaderUtilities.getEnums(null, callback, presenter, onFetchCommand, onFetchCompleteCommand); assertNoInteractions(); }
@Test public void checkEmptyDefinition() { final Callback<Map<String, String>> callback = (result) -> assertTrue(result.isEmpty()); enumLoaderUtilities.getEnums(new DropDownData(), callback, presenter, onFetchCommand, onFetchCompleteCommand); assertNoInteractions(); }