}
@Test
public void testOnClick() throws Exception {
// Given:
HasSelectableSource firstSelectableSource =
Mockito.mock(HasSelectableSource.class);
when(clickEvent.getSource()).thenReturn(firstSelectableSource);
// When: click on the first time (we don't have any previous selected
// source)
presenter.onClick(clickEvent);
// Then:
verify(firstSelectableSource).setSelected(true);
verify(eventBus).fireEvent(RequestValidationEvent.EVENT);
// When: click again we will have previous selection source
HasSelectableSource anotherSelectableSource =
Mockito.mock(HasSelectableSource.class);
when(clickEvent.getSource()).thenReturn(anotherSelectableSource);
presenter.onClick(clickEvent);
verify(firstSelectableSource).setSelected(false);