@Test public void testInitializeCheckButtonsCanUpdateProject() { doReturn(promises.resolve(false)).when(this.projectController).canUpdateProject(any()); this.populatedAssetsScreen.init(); verify(this.view, times(1)).enableAddAssetButton(eq(false)); verify(this.view, times(1)).enableImportButton(eq(false)); }
@PostConstruct public void init() { this.workspaceProject = libraryPlaces.getActiveWorkspace(); this.view.init(this); this.filterType = "ALL"; this.view.setCategories(this.categoryUtils.createCategories()); this.filter = ""; this.currentPage = 1; this.pageSize = 15; projectController.canUpdateProject(this.libraryPlaces.getActiveWorkspace()).then(userCanUpdateProject -> { this.enableButtons(userCanUpdateProject); newFileUploader.acceptContext(new Callback<Boolean, Void>() { @Override public void onFailure(Void reason) { view.enableImportButton(false); } @Override public void onSuccess(Boolean result) { view.enableImportButton(result && userCanUpdateProject); } }); return promises.resolve(); }); }
PopulatedAssetsScreen { @PostConstruct public void init() { this.workspaceProject = libraryPlaces.getActiveWorkspace(); this.view.init(this); this.filterType = "ALL"; this.view.setCategories(this.categoryUtils.createCategories()); this.filter = ""; this.currentPage = 1; this.pageSize = 15; projectController.canUpdateProject(this.libraryPlaces.getActiveWorkspace()).then(userCanUpdateProject -> { this.enableButtons(userCanUpdateProject); newFileUploader.acceptContext(new Callback<Boolean, Void>() { @Override public void onFailure(Void reason) { view.enableImportButton(false); } @Override public void onSuccess(Boolean result) { view.enableImportButton(result && userCanUpdateProject); } }); return promises.resolve(); }); } }
PopulatedAssetsScreen { @PostConstruct public void init() { this.workspaceProject = libraryPlaces.getActiveWorkspace(); this.view.init(this); this.filterType = "ALL"; this.view.setCategories(this.categoryUtils.createCategories()); this.filter = ""; this.currentPage = 1; this.pageSize = 15; projectController.canUpdateProject(this.libraryPlaces.getActiveWorkspace()).then(userCanUpdateProject -> { this.enableButtons(userCanUpdateProject); newFileUploader.acceptContext(new Callback<Boolean, Void>() { @Override public void onFailure(Void reason) { view.enableImportButton(false); } @Override public void onSuccess(Boolean result) { view.enableImportButton(result && userCanUpdateProject); } }); return promises.resolve(); }); } @Inject  PopulatedAssetsScreen(final PopulatedAssetsScreen.View view,
                                 final CategoriesManagerCache categoriesManagerCache,
                                 final ResourceTypeManagerCache resourceTypeManagerCache,
                                 final BusyIndicatorView busyIndicatorView,
                                 final LibraryPlaces libraryPlaces,
                                 final TranslationService ts,
                                 final Classifier assetClassifier,
                                 final ManagedInstance<AssetItemWidget> assetItemWidget,
                                 final NewFileUploader newFileUploader,
                                 final NewResourcePresenter newResourcePresenter,
                                 final ProjectController projectController,
                                 final Event<UpdatedAssetsEvent> updatedAssetsEventEvent,
                                 final EmptyState emptyState,
                                 final CategoryUtils categoryUtils,
                                 final DateUtils dateUtils,
                                 final AssetQueryService assetQueryService,
                                 final Event<WorkspaceProjectContextChangeEvent> contextChangeEvent,
                                 final Promises promises); }
PopulatedAssetsScreen { @PostConstruct public void init() { this.workspaceProject = libraryPlaces.getActiveWorkspace(); this.view.init(this); this.filterType = "ALL"; this.view.setCategories(this.categoryUtils.createCategories()); this.filter = ""; this.currentPage = 1; this.pageSize = 15; projectController.canUpdateProject(this.libraryPlaces.getActiveWorkspace()).then(userCanUpdateProject -> { this.enableButtons(userCanUpdateProject); newFileUploader.acceptContext(new Callback<Boolean, Void>() { @Override public void onFailure(Void reason) { view.enableImportButton(false); } @Override public void onSuccess(Boolean result) { view.enableImportButton(result && userCanUpdateProject); } }); return promises.resolve(); }); } @Inject  PopulatedAssetsScreen(final PopulatedAssetsScreen.View view,
                                 final CategoriesManagerCache categoriesManagerCache,
                                 final ResourceTypeManagerCache resourceTypeManagerCache,
                                 final BusyIndicatorView busyIndicatorView,
                                 final LibraryPlaces libraryPlaces,
                                 final TranslationService ts,
                                 final Classifier assetClassifier,
                                 final ManagedInstance<AssetItemWidget> assetItemWidget,
                                 final NewFileUploader newFileUploader,
                                 final NewResourcePresenter newResourcePresenter,
                                 final ProjectController projectController,
                                 final Event<UpdatedAssetsEvent> updatedAssetsEventEvent,
                                 final EmptyState emptyState,
                                 final CategoryUtils categoryUtils,
                                 final DateUtils dateUtils,
                                 final AssetQueryService assetQueryService,
                                 final Event<WorkspaceProjectContextChangeEvent> contextChangeEvent,
                                 final Promises promises); @PostConstruct void init(); void onAssetListUpdated(@Observes @Routed ProjectAssetListUpdated event); void importAsset(); void setFilterType(String filterType); void showSearchHitNothing(); void showEmptyState(String title,
                               String message); void hideEmptyState(); void addAsset(); void nextPage(); void prevPage(); void setCurrentPage(Integer currentPage); void search(String filterText); View getView(); }
PopulatedAssetsScreen { @PostConstruct public void init() { this.workspaceProject = libraryPlaces.getActiveWorkspace(); this.view.init(this); this.filterType = "ALL"; this.view.setCategories(this.categoryUtils.createCategories()); this.filter = ""; this.currentPage = 1; this.pageSize = 15; projectController.canUpdateProject(this.libraryPlaces.getActiveWorkspace()).then(userCanUpdateProject -> { this.enableButtons(userCanUpdateProject); newFileUploader.acceptContext(new Callback<Boolean, Void>() { @Override public void onFailure(Void reason) { view.enableImportButton(false); } @Override public void onSuccess(Boolean result) { view.enableImportButton(result && userCanUpdateProject); } }); return promises.resolve(); }); } @Inject  PopulatedAssetsScreen(final PopulatedAssetsScreen.View view,
                                 final CategoriesManagerCache categoriesManagerCache,
                                 final ResourceTypeManagerCache resourceTypeManagerCache,
                                 final BusyIndicatorView busyIndicatorView,
                                 final LibraryPlaces libraryPlaces,
                                 final TranslationService ts,
                                 final Classifier assetClassifier,
                                 final ManagedInstance<AssetItemWidget> assetItemWidget,
                                 final NewFileUploader newFileUploader,
                                 final NewResourcePresenter newResourcePresenter,
                                 final ProjectController projectController,
                                 final Event<UpdatedAssetsEvent> updatedAssetsEventEvent,
                                 final EmptyState emptyState,
                                 final CategoryUtils categoryUtils,
                                 final DateUtils dateUtils,
                                 final AssetQueryService assetQueryService,
                                 final Event<WorkspaceProjectContextChangeEvent> contextChangeEvent,
                                 final Promises promises); @PostConstruct void init(); void onAssetListUpdated(@Observes @Routed ProjectAssetListUpdated event); void importAsset(); void setFilterType(String filterType); void showSearchHitNothing(); void showEmptyState(String title,
                               String message); void hideEmptyState(); void addAsset(); void nextPage(); void prevPage(); void setCurrentPage(Integer currentPage); void search(String filterText); View getView();  }