DropDownEditor implements IsWidget, LeafAttributeEditor<String> { @PostConstruct public void init() { view.init(this); view.setDropDown(dropDown); dropDown.setSearchEnabled(false); dropDown.setSearchService(this::getDropDownEntries); dropDown.setOnChange(this::onEntrySelected); } @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 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 testInit() { verify(liveSearchDropDown).setSearchEnabled(false); verify(liveSearchDropDown).setSearchService(any()); assertNull(presenter.getValue()); }