LocalSearchForm implements IsElement { public void setModel(LocalSearchPhaseConfigModel model) { this.model = model; if (model.getLocalSearchType() == null) { model.setLocalSearchType(LocalSearchType.LATE_ACCEPTANCE); } view.setSelectedLocalSearchType(model.getLocalSearchType().name()); } @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 setModelNullAttribute() { when(model.getLocalSearchType()).thenReturn(null).thenReturn(LocalSearchType.LATE_ACCEPTANCE); localSearchForm.setModel(model); verify(model).setLocalSearchType(LocalSearchType.LATE_ACCEPTANCE); }
@Test public void setModelNonNullAttribute() { when(model.getLocalSearchType()).thenReturn(LocalSearchType.LATE_ACCEPTANCE); localSearchForm.setModel(model); verify(model, times(0)).setLocalSearchType(LocalSearchType.LATE_ACCEPTANCE); }