Last active
December 26, 2015 04:08
-
-
Save nbuesing/7090504 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private SampleWidget sampleWidget; | |
private ClickHandler clickHandler; | |
@Before | |
public void setUp() { | |
Mockito.when(button.addClickHandler(Mockito.any(ClickHandler.class))).thenAnswer(new Answer() { | |
public Object answer(InvocationOnMock aInvocation) throws Throwable { | |
clickHandler = (ClickHandler) aInvocation.getArguments()[0]; | |
return null; | |
} | |
}); | |
sampleWidget = new SampleWidget(); | |
} | |
@Test | |
public void clickOnButton() { | |
clickHandler.onClick(new ClickEvent(){}); | |
//... | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment