use of org.guvnor.ala.ui.client.wizard.providertype.item.ProviderTypeItemPresenter 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.wizard.providertype.item.ProviderTypeItemPresenter in project kie-wb-common by kiegroup.
the class EnableProviderTypePagePresenterTest method testSetup.
@Test
public void testSetup() {
presenter.setup(providerTypeStatus);
verify(view, times(1)).clear();
assertEquals(providerTypeStatus.size(), presenter.getItemPresenters().size());
for (int i = 0; i < presenter.getItemPresenters().size(); i++) {
ProviderTypeItemPresenter itemPresenter = presenter.getItemPresenters().get(i);
Pair<ProviderType, ProviderTypeStatus> pair = providerTypeStatus.get(i);
verify(itemPresenter, times(1)).setup(pair.getK1(), pair.getK2());
verify(itemPresenter, times(1)).addContentChangeHandler(any(ContentChangeHandler.class));
verify(view, times(1)).addProviderType(itemPresenter.getView());
}
verify(providerTypeItemPresenterInstance, times(providerTypeStatus.size())).get();
}
Aggregations