@Test public void setCurrentPageTest() throws NoSuchFieldException { new FieldSetter(presenter, PopulatedChangeRequestListPresenter.class.getDeclaredField("totalPages")) .set(10); new FieldSetter(presenter, PopulatedChangeRequestListPresenter.class.getDeclaredField("filterType")) .set("ALL"); presenter.setCurrentPage(5); verify(view).enablePreviousButton(anyBoolean()); verify(view).enableNextButton(anyBoolean()); }
public void setCurrentPage(final int currentPage) { if (currentPage <= totalPages && currentPage > 0) { this.currentPage = currentPage; this.refreshList(); } else { this.view.setCurrentPage(this.currentPage); } }
PopulatedChangeRequestListPresenter { public void setCurrentPage(final int currentPage) { if (currentPage <= totalPages && currentPage > 0) { this.currentPage = currentPage; this.refreshList(); } else { this.view.setCurrentPage(this.currentPage); } } }
PopulatedChangeRequestListPresenter { public void setCurrentPage(final int currentPage) { if (currentPage <= totalPages && currentPage > 0) { this.currentPage = currentPage; this.refreshList(); } else { this.view.setCurrentPage(this.currentPage); } } @Inject  PopulatedChangeRequestListPresenter(final View view,
                                               final ProjectController projectController,
                                               final LibraryPlaces libraryPlaces,
                                               final Promises promises,
                                               final EmptyState emptyState,
                                               final TranslationService ts,
                                               final ManagedInstance<ChangeRequestListItemView> changeRequestItemViews,
                                               final Caller<ChangeRequestService> changeRequestService,
                                               final BusyIndicatorView busyIndicatorView,
                                               final DateUtils dateUtils); }
PopulatedChangeRequestListPresenter { public void setCurrentPage(final int currentPage) { if (currentPage <= totalPages && currentPage > 0) { this.currentPage = currentPage; this.refreshList(); } else { this.view.setCurrentPage(this.currentPage); } } @Inject  PopulatedChangeRequestListPresenter(final View view,
                                               final ProjectController projectController,
                                               final LibraryPlaces libraryPlaces,
                                               final Promises promises,
                                               final EmptyState emptyState,
                                               final TranslationService ts,
                                               final ManagedInstance<ChangeRequestListItemView> changeRequestItemViews,
                                               final Caller<ChangeRequestService> changeRequestService,
                                               final BusyIndicatorView busyIndicatorView,
                                               final DateUtils dateUtils); @PostConstruct void postConstruct(); View getView(); void onChangeRequestListUpdated(@Observes final ChangeRequestListUpdatedEvent event); void onChangeRequestUpdated(@Observes final ChangeRequestUpdatedEvent event); void onChangeRequestStatusUpdated(@Observes final ChangeRequestStatusUpdatedEvent event); void onRepositoryFileListUpdated(@Observes final RepositoryFileListUpdatedEvent event); void nextPage(); void prevPage(); void setCurrentPage(final int currentPage); void setFilterType(final String filterType); void submitChangeRequest(); void search(final String searchText); void showSearchHitNothing(); }
PopulatedChangeRequestListPresenter { public void setCurrentPage(final int currentPage) { if (currentPage <= totalPages && currentPage > 0) { this.currentPage = currentPage; this.refreshList(); } else { this.view.setCurrentPage(this.currentPage); } } @Inject  PopulatedChangeRequestListPresenter(final View view,
                                               final ProjectController projectController,
                                               final LibraryPlaces libraryPlaces,
                                               final Promises promises,
                                               final EmptyState emptyState,
                                               final TranslationService ts,
                                               final ManagedInstance<ChangeRequestListItemView> changeRequestItemViews,
                                               final Caller<ChangeRequestService> changeRequestService,
                                               final BusyIndicatorView busyIndicatorView,
                                               final DateUtils dateUtils); @PostConstruct void postConstruct(); View getView(); void onChangeRequestListUpdated(@Observes final ChangeRequestListUpdatedEvent event); void onChangeRequestUpdated(@Observes final ChangeRequestUpdatedEvent event); void onChangeRequestStatusUpdated(@Observes final ChangeRequestStatusUpdatedEvent event); void onRepositoryFileListUpdated(@Observes final RepositoryFileListUpdatedEvent event); void nextPage(); void prevPage(); void setCurrentPage(final int currentPage); void setFilterType(final String filterType); void submitChangeRequest(); void search(final String searchText); void showSearchHitNothing();  }