@Test public void testMakeExpressionEditorButton() { final HasConstraints hasConstraints = mock(HasConstraints.class); final FormStylePopup popup = mock(FormStylePopup.class); final Button button = mock(Button.class); final ClickHandler clickHandler = mock(ClickHandler.class); doReturn(button).when(popupCreator).makeExpressionEditorButton(); doReturn(clickHandler).when(popupCreator).onExpressionEditorButtonClick(hasConstraints, popup); popupCreator.makeExpressionEditorButton(hasConstraints, popup); verify(button).addClickHandler(clickHandler); }
Button makeExpressionEditorButton(final HasConstraints hasConstraints, final FormStylePopup popup) { final Button button = makeExpressionEditorButton(); button.addClickHandler(onExpressionEditorButtonClick(hasConstraints, popup)); return button; }
PopupCreator { Button makeExpressionEditorButton(final HasConstraints hasConstraints, final FormStylePopup popup) { final Button button = makeExpressionEditorButton(); button.addClickHandler(onExpressionEditorButtonClick(hasConstraints, popup)); return button; } }
PopupCreator { Button makeExpressionEditorButton(final HasConstraints hasConstraints, final FormStylePopup popup) { final Button button = makeExpressionEditorButton(); button.addClickHandler(onExpressionEditorButtonClick(hasConstraints, popup)); return button; }  }
PopupCreator { Button makeExpressionEditorButton(final HasConstraints hasConstraints, final FormStylePopup popup) { final Button button = makeExpressionEditorButton(); button.addClickHandler(onExpressionEditorButtonClick(hasConstraints, popup)); return button; }  FactPattern getPattern(); void setPattern(FactPattern pattern); AsyncPackageDataModelOracle getDataModelOracle(); void setDataModelOracle(AsyncPackageDataModelOracle oracle); RuleModeller getModeller(); void setModeller(RuleModeller modeller); boolean isBindable(); void setBindable(boolean bindable); void showBindFieldPopup(final FactPattern fp,
                                   final SingleFieldConstraint con,
                                   final ModelField[] fields,
                                   final PopupCreator popupCreator); void showPatternPopupForComposite(final HasConstraints hasConstraints); void showPatternPopup(final FactPattern fp,
                                 final SingleFieldConstraint con,
                                 final boolean isNested); }
PopupCreator { Button makeExpressionEditorButton(final HasConstraints hasConstraints, final FormStylePopup popup) { final Button button = makeExpressionEditorButton(); button.addClickHandler(onExpressionEditorButtonClick(hasConstraints, popup)); return button; }  FactPattern getPattern(); void setPattern(FactPattern pattern); AsyncPackageDataModelOracle getDataModelOracle(); void setDataModelOracle(AsyncPackageDataModelOracle oracle); RuleModeller getModeller(); void setModeller(RuleModeller modeller); boolean isBindable(); void setBindable(boolean bindable); void showBindFieldPopup(final FactPattern fp,
                                   final SingleFieldConstraint con,
                                   final ModelField[] fields,
                                   final PopupCreator popupCreator); void showPatternPopupForComposite(final HasConstraints hasConstraints); void showPatternPopup(final FactPattern fp,
                                 final SingleFieldConstraint con,
                                 final boolean isNested);  }