LocalSearchForm implements IsElement { private void initLocalSearchTypeSelectOptions() { List<Pair<String, String>> localSearchTypeOptions = new ArrayList<>(); for (LocalSearchType localSearchType : LocalSearchType.values()) { if (LocalSearchType.SIMULATED_ANNEALING == localSearchType) { continue; } Pair<String, String> option = new Pair<>(solverEditorLookupConstants.getString(localSearchType.name()), localSearchType.name()); localSearchTypeOptions.add(option); } view.initLocalSearchTypeSelectOptions(localSearchTypeOptions); } @Inject  LocalSearchForm(final LocalSearchFormView view); void setPhaseConfigForm(PhaseConfigForm phaseConfigForm); void onLocalSearchTypeSelected(final String localSearchType); void onLocalSearchRemoved(); LocalSearchPhaseConfigModel getModel(); void setModel(LocalSearchPhaseConfigModel model); @Override HTMLElement getElement();  }
@Test public void initLocalSearchForm() { verify(view).setPresenter(localSearchForm); ArgumentCaptor<List> localSearchTypeSelectOptionsCaptor = ArgumentCaptor.forClass(List.class); verify(view).initLocalSearchTypeSelectOptions(localSearchTypeSelectOptionsCaptor.capture()); List value = localSearchTypeSelectOptionsCaptor.getValue(); assertEquals(LocalSearchType.values().length - 1, value.size()); }
@Test public void simulatedAnnealingIsIgnored() { ArgumentCaptor<List> listArgumentCaptor = ArgumentCaptor.forClass(List.class); verify(view, times(1)).initLocalSearchTypeSelectOptions(listArgumentCaptor.capture()); List<Pair<String, String>> value = listArgumentCaptor.getValue(); boolean simulatedAnnealingPresent = value.stream().anyMatch(p -> LocalSearchType.SIMULATED_ANNEALING.toString().equals(p.getK2())); assertFalse(simulatedAnnealingPresent); }