DeploymentsSectionPresenter extends Section<ProjectScreenModel> { @Override public Promise<Void> setup(final ProjectScreenModel ignore) { return setup(); } @Inject  DeploymentsSectionPresenter(final View view,
                                       final Promises promises,
                                       final MenuItem<ProjectScreenModel> menuItem,
                                       final WorkspaceProjectContext projectContext,
                                       final Caller<DDEditorService> ddEditorService,
                                       final ManagedInstance<ObservablePath> observablePaths,
                                       final Event<SettingsSectionChange<ProjectScreenModel>> settingsSectionChangeEvent,
                                       final Event<NotificationEvent> notificationEvent,
                                       final SectionManager<DeploymentDescriptorModel> sectionManager,
                                       final DeploymentsSections deploymentsSections); @PostConstruct void init(); @Override Promise<Void> setup(final ProjectScreenModel ignore); @Override Promise<Void> save(final String comment,
                              final Supplier<Promise<Void>> chain); void onSectionChanged(@Observes final SettingsSectionChange<DeploymentDescriptorModel> settingsSectionChange); @Override int currentHashCode(); @Override SectionView<?> getView();  }
@Test public void testSetup() { final DeploymentDescriptorModel model = mock(DeploymentDescriptorModel.class); doReturn(promises.resolve()).when(presenter).createIfNotExists(); doReturn(promises.resolve(model)).when(presenter).loadDeploymentDescriptor(); when(sectionManager.goToCurrentSection()).thenReturn(promises.resolve()); presenter.setup(mock(ProjectScreenModel.class)).catch_(i -> { Assert.fail("Promise should've been resolved!\n" + ((Throwable) i).getMessage()); return promises.resolve(); }); verify(presenter).createIfNotExists(); verify(presenter).loadDeploymentDescriptor(); verify(view).init(eq(presenter)); verify(section1).setup(eq(model)); verify(section2).setup(eq(model)); verify(sectionManager).goToCurrentSection(); verify(sectionManager).resetAllDirtyIndicators(); }