@Test public void postConstructWithoutPermissionsTest() { doReturn(promises.resolve(false)).when(this.projectController).canSubmitChangeRequest(any()); presenter.postConstruct(); verify(view).init(presenter); verify(view).enableSubmitChangeRequestButton(false); }
@PostConstruct public void postConstruct() { this.workspaceProject = this.libraryPlaces.getActiveWorkspace(); this.view.init(this); projectController.canSubmitChangeRequest(workspaceProject).then(userCanSubmitChangeRequest -> { view.enableSubmitChangeRequestButton(userCanSubmitChangeRequest); return promises.resolve(); }); }
EmptyChangeRequestListPresenter { @PostConstruct public void postConstruct() { this.workspaceProject = this.libraryPlaces.getActiveWorkspace(); this.view.init(this); projectController.canSubmitChangeRequest(workspaceProject).then(userCanSubmitChangeRequest -> { view.enableSubmitChangeRequestButton(userCanSubmitChangeRequest); return promises.resolve(); }); } }
EmptyChangeRequestListPresenter { @PostConstruct public void postConstruct() { this.workspaceProject = this.libraryPlaces.getActiveWorkspace(); this.view.init(this); projectController.canSubmitChangeRequest(workspaceProject).then(userCanSubmitChangeRequest -> { view.enableSubmitChangeRequestButton(userCanSubmitChangeRequest); return promises.resolve(); }); } @Inject  EmptyChangeRequestListPresenter(final View view,
                                           final ProjectController projectController,
                                           final LibraryPlaces libraryPlaces,
                                           final Promises promises); }
EmptyChangeRequestListPresenter { @PostConstruct public void postConstruct() { this.workspaceProject = this.libraryPlaces.getActiveWorkspace(); this.view.init(this); projectController.canSubmitChangeRequest(workspaceProject).then(userCanSubmitChangeRequest -> { view.enableSubmitChangeRequestButton(userCanSubmitChangeRequest); return promises.resolve(); }); } @Inject  EmptyChangeRequestListPresenter(final View view,
                                           final ProjectController projectController,
                                           final LibraryPlaces libraryPlaces,
                                           final Promises promises); @PostConstruct void postConstruct(); View getView(); void goToSubmitChangeRequest(); }
EmptyChangeRequestListPresenter { @PostConstruct public void postConstruct() { this.workspaceProject = this.libraryPlaces.getActiveWorkspace(); this.view.init(this); projectController.canSubmitChangeRequest(workspaceProject).then(userCanSubmitChangeRequest -> { view.enableSubmitChangeRequestButton(userCanSubmitChangeRequest); return promises.resolve(); }); } @Inject  EmptyChangeRequestListPresenter(final View view,
                                           final ProjectController projectController,
                                           final LibraryPlaces libraryPlaces,
                                           final Promises promises); @PostConstruct void postConstruct(); View getView(); void goToSubmitChangeRequest();  }