@Test public void testSearchFieldDelayedTaskOnExecute_Case1() { when(textFieldMock.getText()).thenReturn("123"); final HasHandlers hasHandlersMock = mock(HasHandlers.class); SearchFieldDecorator<TextField>.SearchFieldDelayedTask taskUnderTest = unitUnderTest.new SearchFieldDelayedTask(textFieldMock, hasHandlersMock, unitUnderTest.minChars); verify(textFieldMock).addKeyUpHandler(any(KeyUpHandler.class)); taskUnderTest.onExecute(); verify(textFieldMock).getText(); verify(hasHandlersMock).fireEvent(any(SubmitTextSearchEvent.class)); verifyNoMoreInteractions(textFieldMock, hasHandlersMock); }
@Override public void fireEvent(GwtEvent<?> event) { if (handlerManager != null) { handlerManager.fireEvent(event); } }
SearchFieldDecorator implements HasSubmitTextSearchEvents, KeyUpHandler, HasHandlers { @Override public void fireEvent(GwtEvent<?> event) { if (handlerManager != null) { handlerManager.fireEvent(event); } } }
SearchFieldDecorator implements HasSubmitTextSearchEvents, KeyUpHandler, HasHandlers { @Override public void fireEvent(GwtEvent<?> event) { if (handlerManager != null) { handlerManager.fireEvent(event); } } SearchFieldDecorator(final F searchField);   SearchFieldDecorator(final F searchField, final SearchFieldDelayedTask task); }
SearchFieldDecorator implements HasSubmitTextSearchEvents, KeyUpHandler, HasHandlers { @Override public void fireEvent(GwtEvent<?> event) { if (handlerManager != null) { handlerManager.fireEvent(event); } } SearchFieldDecorator(final F searchField);   SearchFieldDecorator(final F searchField, final SearchFieldDelayedTask task); @Override HandlerRegistration addSubmitTextSearchEventHandler(SubmitTextSearchEventHandler handler); @Override void fireEvent(GwtEvent<?> event); @Override void onKeyUp(KeyUpEvent event); }
SearchFieldDecorator implements HasSubmitTextSearchEvents, KeyUpHandler, HasHandlers { @Override public void fireEvent(GwtEvent<?> event) { if (handlerManager != null) { handlerManager.fireEvent(event); } } SearchFieldDecorator(final F searchField);   SearchFieldDecorator(final F searchField, final SearchFieldDelayedTask task); @Override HandlerRegistration addSubmitTextSearchEventHandler(SubmitTextSearchEventHandler handler); @Override void fireEvent(GwtEvent<?> event); @Override void onKeyUp(KeyUpEvent event);  }