use of org.guvnor.ala.ui.client.util.ContentChangeHandler in project kie-wb-common by kiegroup.
the class ProviderTypeItemPresenterTest method testOnItemClickWhenSelected.
@Test
public void testOnItemClickWhenSelected() {
ContentChangeHandler changeHandler = mock(ContentChangeHandler.class);
presenter.addContentChangeHandler(changeHandler);
when(view.isSelected()).thenReturn(true);
presenter.onItemClick();
verify(view, times(1)).setSelected(false);
verify(changeHandler, times(1)).onContentChange();
}
use of org.guvnor.ala.ui.client.util.ContentChangeHandler in project kie-wb-common by kiegroup.
the class EnableProviderTypePagePresenter method setup.
public void setup(final List<Pair<ProviderType, ProviderTypeStatus>> providerTypeStatus) {
view.clear();
clearProviderTypes();
final ContentChangeHandler contentChangeHandler = this::onProviderTypeSelectionChange;
providerTypeStatus.forEach(pair -> {
final ProviderTypeItemPresenter presenter = newProviderTypeItemPresenter();
presenter.setup(pair.getK1(), pair.getK2());
presenter.addContentChangeHandler(contentChangeHandler);
itemPresenters.add(presenter);
view.addProviderType(presenter.getView());
});
}
use of org.guvnor.ala.ui.client.util.ContentChangeHandler in project kie-wb-common by kiegroup.
the class ProviderTypeItemPresenterTest method testContentChange.
@Test
public void testContentChange() {
ContentChangeHandler changeHandler = mock(ContentChangeHandler.class);
presenter.addContentChangeHandler(changeHandler);
presenter.fireChangeHandlers();
verify(changeHandler, times(1)).onContentChange();
}
use of org.guvnor.ala.ui.client.util.ContentChangeHandler in project kie-wb-common by kiegroup.
the class ProviderTypeItemPresenterTest method testOnItemClickWhenNotSelected.
@Test
public void testOnItemClickWhenNotSelected() {
ContentChangeHandler changeHandler = mock(ContentChangeHandler.class);
presenter.addContentChangeHandler(changeHandler);
when(view.isSelected()).thenReturn(false);
presenter.onItemClick();
verify(view, times(1)).setSelected(true);
verify(changeHandler, times(1)).onContentChange();
}
Aggregations