@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(); }
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()); }); }
EnableProviderTypePagePresenter implements WizardPage { 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()); }); } }
EnableProviderTypePagePresenter implements WizardPage { 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()); }); } @Inject  EnableProviderTypePagePresenter(final View view,
                                           final Event<WizardPageStatusChangeEvent> wizardPageStatusChangeEvent,
                                           final ManagedInstance<ProviderTypeItemPresenter> providerTypeItemPresenterInstance); }
EnableProviderTypePagePresenter implements WizardPage { 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()); }); } @Inject  EnableProviderTypePagePresenter(final View view,
                                           final Event<WizardPageStatusChangeEvent> wizardPageStatusChangeEvent,
                                           final ManagedInstance<ProviderTypeItemPresenter> providerTypeItemPresenterInstance); @PostConstruct void init(); void setup(final List<Pair<ProviderType, ProviderTypeStatus>> providerTypeStatus); @Override void initialise(); @Override void prepareView(); @Override void isComplete(final Callback<Boolean> callback); @Override String getTitle(); @Override Widget asWidget(); Collection<ProviderType> getSelectedProviderTypes(); }
EnableProviderTypePagePresenter implements WizardPage { 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()); }); } @Inject  EnableProviderTypePagePresenter(final View view,
                                           final Event<WizardPageStatusChangeEvent> wizardPageStatusChangeEvent,
                                           final ManagedInstance<ProviderTypeItemPresenter> providerTypeItemPresenterInstance); @PostConstruct void init(); void setup(final List<Pair<ProviderType, ProviderTypeStatus>> providerTypeStatus); @Override void initialise(); @Override void prepareView(); @Override void isComplete(final Callback<Boolean> callback); @Override String getTitle(); @Override Widget asWidget(); Collection<ProviderType> getSelectedProviderTypes();  }