@Test public void testSetup() { final ProjectScreenModel model = mock(ProjectScreenModel.class); doReturn(new ModuleRepositories()).when(model).getRepositories(); validationPresenter.setup(model).catch_(i -> { Assert.fail("Promise should've been resolved!"); return promises.resolve(); }); verify(view).init(eq(validationPresenter)); verify(validationItemPresenters).setup(any(), any(), any()); }
@Override public Promise<Void> setup(final ProjectScreenModel model) { repositories = model.getRepositories(); view.init(this); validationItemPresenters.setup( view.getRepositoriesTable(), repositories.getRepositories().stream().sorted(comparing(r -> r.getMetadata().getId())).collect(toList()), (repository, presenter) -> presenter.setup(repository, this)); return promises.resolve(); }
ValidationPresenter extends Section<ProjectScreenModel> { @Override public Promise<Void> setup(final ProjectScreenModel model) { repositories = model.getRepositories(); view.init(this); validationItemPresenters.setup( view.getRepositoriesTable(), repositories.getRepositories().stream().sorted(comparing(r -> r.getMetadata().getId())).collect(toList()), (repository, presenter) -> presenter.setup(repository, this)); return promises.resolve(); } }
ValidationPresenter extends Section<ProjectScreenModel> { @Override public Promise<Void> setup(final ProjectScreenModel model) { repositories = model.getRepositories(); view.init(this); validationItemPresenters.setup( view.getRepositoriesTable(), repositories.getRepositories().stream().sorted(comparing(r -> r.getMetadata().getId())).collect(toList()), (repository, presenter) -> presenter.setup(repository, this)); return promises.resolve(); } @Inject  ValidationPresenter(final ValidationPresenter.View view,
                               final Promises promises,
                               final MenuItem<ProjectScreenModel> menuItem,
                               final Event<SettingsSectionChange<ProjectScreenModel>> settingsSectionChangeEvent,
                               final ValidationListPresenter validationItemPresenters); }
ValidationPresenter extends Section<ProjectScreenModel> { @Override public Promise<Void> setup(final ProjectScreenModel model) { repositories = model.getRepositories(); view.init(this); validationItemPresenters.setup( view.getRepositoriesTable(), repositories.getRepositories().stream().sorted(comparing(r -> r.getMetadata().getId())).collect(toList()), (repository, presenter) -> presenter.setup(repository, this)); return promises.resolve(); } @Inject  ValidationPresenter(final ValidationPresenter.View view,
                               final Promises promises,
                               final MenuItem<ProjectScreenModel> menuItem,
                               final Event<SettingsSectionChange<ProjectScreenModel>> settingsSectionChangeEvent,
                               final ValidationListPresenter validationItemPresenters); @Override Promise<Void> setup(final ProjectScreenModel model); @Override int currentHashCode(); @Override SectionView<?> getView(); }
ValidationPresenter extends Section<ProjectScreenModel> { @Override public Promise<Void> setup(final ProjectScreenModel model) { repositories = model.getRepositories(); view.init(this); validationItemPresenters.setup( view.getRepositoriesTable(), repositories.getRepositories().stream().sorted(comparing(r -> r.getMetadata().getId())).collect(toList()), (repository, presenter) -> presenter.setup(repository, this)); return promises.resolve(); } @Inject  ValidationPresenter(final ValidationPresenter.View view,
                               final Promises promises,
                               final MenuItem<ProjectScreenModel> menuItem,
                               final Event<SettingsSectionChange<ProjectScreenModel>> settingsSectionChangeEvent,
                               final ValidationListPresenter validationItemPresenters); @Override Promise<Void> setup(final ProjectScreenModel model); @Override int currentHashCode(); @Override SectionView<?> getView();  }