DropDownEditor implements IsWidget, LeafAttributeEditor<String> { public void clear() { this.entries.clear(); this.value = null; this.dropDown.clear(); } @Inject  DropDownEditor(final View view,
                          final LiveSearchDropDown dropDown,
                          final Event<org.dashbuilder.common.client.event.ValueChangeEvent<String>> valueChangeEvent); @PostConstruct void init(); @Override Widget asWidget(); void getDropDownEntries(String pattern, int maxResults, LiveSearchCallback<String> callback); void getExactEntry(String key, LiveSearchCallback<String> callback); void onEntrySelected(); String getSelectedValue(); void setSelectHint(String hint); Entry newEntry(final String value, String hint); void setEntries(final Collection<Entry> entries); void addHelpContent(final String title, final String content, final Placement placement); void clear(); @Override void showErrors(final List<EditorError> errors); @Override String getValue(); @Override void setValue(final String value); public View view; }
@Test public void testClear() { presenter.setValue("entry2"); presenter.clear(); verify(liveSearchDropDown).clear();; assertNull(presenter.getValue()); }