AppCategoriesPresenterImpl implements AppCategoriesView.Presenter,
                                                   AppCategoriesView.AppCategoryHierarchyProvider,
                                                   AppUpdatedEvent.AppUpdatedEventHandler,
                                                   AppSavedEvent.AppSavedEventHandler,
                                                   AppCategorySelectionChangedEvent.AppCategorySelectionChangedEventHandler { @Override public void go(final HasId selectedAppCategory, final DETabPanel tabPanel) { this.viewTabPanel = tabPanel; viewTabPanel.add(workspaceView.getTree(), new TabItemConfig(appearance.workspaceTab()), baseId + AppsModule.Ids.WORKSPACE_TAB); viewTabPanel.add(hpcView.getTree(), new TabItemConfig(appearance.hpcTab()), baseId + AppsModule.Ids.HPC_TAB); workspaceView.getTree().mask(appearance.getAppCategoriesLoadingMask()); hpcView.getTree().mask(appearance.getAppCategoriesLoadingMask()); appService.getAppCategories(true, new AsyncCallback<List<AppCategory>>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); viewTabPanel.unmask(); } @Override public void onSuccess(List<AppCategory> result) { filterCategories(result); addCategoriesToWorkspaceTree(selectedAppCategory); addCategoriesToHPCTree(); addHPCTabSelectionHandler(); workspaceView.getTree().unmask(); hpcView.getTree().unmask(); } }); } @Inject  AppCategoriesPresenterImpl(final DEProperties props,
                               final JsonUtil jsonUtil,
                               final EventBus eventBus,
                               final AppCategoriesViewFactory viewFactory); @Override List<String> getGroupHierarchy(AppCategory appCategory); @Override AppCategory getSelectedAppCategory(); @Override AppCategoriesView getWorkspaceView(); @Override void go(final HasId selectedAppCategory, final DETabPanel tabPanel); @Override void setViewDebugId(String baseID); @Override void onAppSaved(AppSavedEvent event); @Override void onAppSearchResultLoad(AppSearchResultLoadEvent event); @Override void onAppUpdated(final AppUpdatedEvent event); @Override void onCopyAppSelected(CopyAppSelected event); @Override void onCopyWorkflowSelected(final CopyWorkflowSelected event); @Override HandlerRegistration addAppCategorySelectedEventHandler(AppCategorySelectionChangedEvent.AppCategorySelectionChangedEventHandler handler); @Override void onAppCategorySelectionChanged(AppCategorySelectionChangedEvent event);  }
@Test public void viewMaskedAndUnmaskedOnGo() { when(treeStoreMock.getAll()).thenReturn(Collections.<AppCategory>emptyList()); when(appearanceMock.getAppCategoriesLoadingMask()).thenReturn("mask"); uut.go(null, tabPanelMock); verify(treeMock, times(2)).mask(anyString()); verify(appServiceMock).getAppCategories(anyBoolean(), appCategoriesCaptor.capture()); appCategoriesCaptor.getValue().onFailure(null); verify(tabPanelMock).unmask(); appCategoriesCaptor.getValue().onSuccess(Collections.<AppCategory>emptyList()); verify(treeStoreMock).addSortInfo(Matchers.<Store.StoreSortInfo<AppCategory>>any()); verify(treeMock, times(2)).unmask(); }