@Test public void setCommentCurrentOutRangeTest() throws NoSuchFieldException { new FieldSetter(presenter, OverviewScreenPresenter.class.getDeclaredField("workspaceProject")).set(workspaceProject); new FieldSetter(presenter, OverviewScreenPresenter.class.getDeclaredField("commentCurrentPage")) .set(10); new FieldSetter(presenter, OverviewScreenPresenter.class.getDeclaredField("commentTotalPages")) .set(10); presenter.setCommentCurrentPage(50); verify(view).setCommentCurrentPage(10); verify(view, never()).enableCommentPreviousButton(anyBoolean()); verify(view, never()).enableCommentNextButton(anyBoolean()); }
public void setCommentCurrentPage(final int currentCommentPage) { if (currentCommentPage <= commentTotalPages && currentCommentPage > 0) { this.commentCurrentPage = currentCommentPage; refreshCommentList(b -> { }); } else { this.view.setCommentCurrentPage(this.commentCurrentPage); } }
OverviewScreenPresenter { public void setCommentCurrentPage(final int currentCommentPage) { if (currentCommentPage <= commentTotalPages && currentCommentPage > 0) { this.commentCurrentPage = currentCommentPage; refreshCommentList(b -> { }); } else { this.view.setCommentCurrentPage(this.commentCurrentPage); } } }
OverviewScreenPresenter { public void setCommentCurrentPage(final int currentCommentPage) { if (currentCommentPage <= commentTotalPages && currentCommentPage > 0) { this.commentCurrentPage = currentCommentPage; refreshCommentList(b -> { }); } else { this.view.setCommentCurrentPage(this.commentCurrentPage); } } @Inject  OverviewScreenPresenter(final View view,
                                   final TranslationService ts,
                                   final ManagedInstance<CommentItemPresenter> commentItemPresenterInstances,
                                   final Caller<ChangeRequestService> changeRequestService,
                                   final LibraryPlaces libraryPlaces,
                                   final ChangeRequestUtils changeRequestUtils,
                                   final SessionInfo sessionInfo); }
OverviewScreenPresenter { public void setCommentCurrentPage(final int currentCommentPage) { if (currentCommentPage <= commentTotalPages && currentCommentPage > 0) { this.commentCurrentPage = currentCommentPage; refreshCommentList(b -> { }); } else { this.view.setCommentCurrentPage(this.commentCurrentPage); } } @Inject  OverviewScreenPresenter(final View view,
                                   final TranslationService ts,
                                   final ManagedInstance<CommentItemPresenter> commentItemPresenterInstances,
                                   final Caller<ChangeRequestService> changeRequestService,
                                   final LibraryPlaces libraryPlaces,
                                   final ChangeRequestUtils changeRequestUtils,
                                   final SessionInfo sessionInfo); @PostConstruct void postConstruct(); View getView(); void addComment(); void reset(); void setup(final ChangeRequest changeRequest,
                      final Consumer<Boolean> finishLoadingCallback); void checkWarnConflict(final ChangeRequest changeRequest); void startEditSummary(); void saveSummaryEdition(); void cancelSummaryEdition(); void startEditDescription(); void saveDescriptionEdition(); void cancelDescriptionEdition(); void nextCommentPage(); void prevCommentPage(); void setCommentCurrentPage(final int currentCommentPage); }
OverviewScreenPresenter { public void setCommentCurrentPage(final int currentCommentPage) { if (currentCommentPage <= commentTotalPages && currentCommentPage > 0) { this.commentCurrentPage = currentCommentPage; refreshCommentList(b -> { }); } else { this.view.setCommentCurrentPage(this.commentCurrentPage); } } @Inject  OverviewScreenPresenter(final View view,
                                   final TranslationService ts,
                                   final ManagedInstance<CommentItemPresenter> commentItemPresenterInstances,
                                   final Caller<ChangeRequestService> changeRequestService,
                                   final LibraryPlaces libraryPlaces,
                                   final ChangeRequestUtils changeRequestUtils,
                                   final SessionInfo sessionInfo); @PostConstruct void postConstruct(); View getView(); void addComment(); void reset(); void setup(final ChangeRequest changeRequest,
                      final Consumer<Boolean> finishLoadingCallback); void checkWarnConflict(final ChangeRequest changeRequest); void startEditSummary(); void saveSummaryEdition(); void cancelSummaryEdition(); void startEditDescription(); void saveDescriptionEdition(); void cancelDescriptionEdition(); void nextCommentPage(); void prevCommentPage(); void setCommentCurrentPage(final int currentCommentPage);  }