@Test public void testGo_invalidIriToAttrMap() throws Exception { when(ontologyUtilMock.createIriToAttrMap(hierarchyListMock)).thenReturn(false); uut = new OntologyHierarchiesPresenterImpl(factoryMock, ontologyServiceMock, eventBusMock, appearanceMock) { @Override void createViewTabs(List<OntologyHierarchy> results) { } }; uut.ontologyUtil = ontologyUtilMock; uut.announcer = announcerMock; uut.appDetailsDlgAsyncProvider = appDetailsDialogProviderMock; uut.appUserService = appUserServiceMock; uut.handlerManager = handlerManagerMock; uut.iriToHierarchyMap = iriToHierarchyMapMock; uut.go(tabPanelMock); verify(ontologyServiceMock).getRootHierarchies(hierarchyListCallback.capture()); hierarchyListCallback.getValue().onSuccess(hierarchyListMock); verify(ontologyUtilMock).createIriToAttrMap(eq(hierarchyListMock)); verify(announcerMock).schedule(isA(ErrorAnnouncementConfig.class)); verifyNoMoreInteractions(ontologyServiceMock, ontologyUtilMock, eventBusMock); }
@Override public void go(final DETabPanel tabPanel) { viewTabPanel = tabPanel; serviceFacade.getRootHierarchies(new AsyncCallback<List<OntologyHierarchy>>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); } @Override public void onSuccess(List<OntologyHierarchy> result) { if (result != null && result.size() > 0) { boolean isValid = ontologyUtil.createIriToAttrMap(result); if (!isValid) { announcer.schedule(new ErrorAnnouncementConfig(appearance.ontologyAttrMatchingFailure())); LOG.log(Level.SEVERE, "ERROR UI's ontology configs do not exist or do not match published ontology!"); } else { createViewTabs(result); } } } }); }
OntologyHierarchiesPresenterImpl implements OntologyHierarchiesView.Presenter,
                                                         OntologyHierarchySelectionChangedEvent.OntologyHierarchySelectionChangedEventHandler,
                                                         AppRatingSelected.AppRatingSelectedHandler,
                                                         AppRatingDeselected.AppRatingDeselectedHandler,
                                                         AppFavoriteSelectedEvent.AppFavoriteSelectedEventHandler,
                                                         DetailsHierarchyClicked.DetailsHierarchyClickedHandler,
                                                         DetailsCategoryClicked.DetailsCategoryClickedHandler { @Override public void go(final DETabPanel tabPanel) { viewTabPanel = tabPanel; serviceFacade.getRootHierarchies(new AsyncCallback<List<OntologyHierarchy>>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); } @Override public void onSuccess(List<OntologyHierarchy> result) { if (result != null && result.size() > 0) { boolean isValid = ontologyUtil.createIriToAttrMap(result); if (!isValid) { announcer.schedule(new ErrorAnnouncementConfig(appearance.ontologyAttrMatchingFailure())); LOG.log(Level.SEVERE, "ERROR UI's ontology configs do not exist or do not match published ontology!"); } else { createViewTabs(result); } } } }); } }
OntologyHierarchiesPresenterImpl implements OntologyHierarchiesView.Presenter,
                                                         OntologyHierarchySelectionChangedEvent.OntologyHierarchySelectionChangedEventHandler,
                                                         AppRatingSelected.AppRatingSelectedHandler,
                                                         AppRatingDeselected.AppRatingDeselectedHandler,
                                                         AppFavoriteSelectedEvent.AppFavoriteSelectedEventHandler,
                                                         DetailsHierarchyClicked.DetailsHierarchyClickedHandler,
                                                         DetailsCategoryClicked.DetailsCategoryClickedHandler { @Override public void go(final DETabPanel tabPanel) { viewTabPanel = tabPanel; serviceFacade.getRootHierarchies(new AsyncCallback<List<OntologyHierarchy>>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); } @Override public void onSuccess(List<OntologyHierarchy> result) { if (result != null && result.size() > 0) { boolean isValid = ontologyUtil.createIriToAttrMap(result); if (!isValid) { announcer.schedule(new ErrorAnnouncementConfig(appearance.ontologyAttrMatchingFailure())); LOG.log(Level.SEVERE, "ERROR UI's ontology configs do not exist or do not match published ontology!"); } else { createViewTabs(result); } } } }); } @Inject  OntologyHierarchiesPresenterImpl(OntologyHierarchiesViewFactory viewFactory,
                                            OntologyServiceFacade serviceFacade,
                                            EventBus eventBus,
                                            OntologyHierarchiesView.OntologyHierarchiesAppearance appearance); }
OntologyHierarchiesPresenterImpl implements OntologyHierarchiesView.Presenter,
                                                         OntologyHierarchySelectionChangedEvent.OntologyHierarchySelectionChangedEventHandler,
                                                         AppRatingSelected.AppRatingSelectedHandler,
                                                         AppRatingDeselected.AppRatingDeselectedHandler,
                                                         AppFavoriteSelectedEvent.AppFavoriteSelectedEventHandler,
                                                         DetailsHierarchyClicked.DetailsHierarchyClickedHandler,
                                                         DetailsCategoryClicked.DetailsCategoryClickedHandler { @Override public void go(final DETabPanel tabPanel) { viewTabPanel = tabPanel; serviceFacade.getRootHierarchies(new AsyncCallback<List<OntologyHierarchy>>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); } @Override public void onSuccess(List<OntologyHierarchy> result) { if (result != null && result.size() > 0) { boolean isValid = ontologyUtil.createIriToAttrMap(result); if (!isValid) { announcer.schedule(new ErrorAnnouncementConfig(appearance.ontologyAttrMatchingFailure())); LOG.log(Level.SEVERE, "ERROR UI's ontology configs do not exist or do not match published ontology!"); } else { createViewTabs(result); } } } }); } @Inject  OntologyHierarchiesPresenterImpl(OntologyHierarchiesViewFactory viewFactory,
                                            OntologyServiceFacade serviceFacade,
                                            EventBus eventBus,
                                            OntologyHierarchiesView.OntologyHierarchiesAppearance appearance); @Override void go(final DETabPanel tabPanel); @Override void setViewDebugId(String baseID); @Override void onAppInfoSelected(final AppInfoSelectedEvent event); @Override void onAppSearchResultLoad(AppSearchResultLoadEvent event); @Override void onOntologyHierarchySelectionChanged(OntologyHierarchySelectionChangedEvent event); @Override void onAppRatingDeselected(AppRatingDeselected event); @Override void onAppRatingSelected(AppRatingSelected event); @Override void onAppFavoriteSelected(AppFavoriteSelectedEvent event); @Override void onDetailsHierarchyClicked(DetailsHierarchyClicked event); @Override void onDetailsCategoryClicked(DetailsCategoryClicked event); @Override HandlerRegistration addOntologyHierarchySelectionChangedEventHandler(
            OntologyHierarchySelectionChangedEvent.OntologyHierarchySelectionChangedEventHandler handler); }
OntologyHierarchiesPresenterImpl implements OntologyHierarchiesView.Presenter,
                                                         OntologyHierarchySelectionChangedEvent.OntologyHierarchySelectionChangedEventHandler,
                                                         AppRatingSelected.AppRatingSelectedHandler,
                                                         AppRatingDeselected.AppRatingDeselectedHandler,
                                                         AppFavoriteSelectedEvent.AppFavoriteSelectedEventHandler,
                                                         DetailsHierarchyClicked.DetailsHierarchyClickedHandler,
                                                         DetailsCategoryClicked.DetailsCategoryClickedHandler { @Override public void go(final DETabPanel tabPanel) { viewTabPanel = tabPanel; serviceFacade.getRootHierarchies(new AsyncCallback<List<OntologyHierarchy>>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); } @Override public void onSuccess(List<OntologyHierarchy> result) { if (result != null && result.size() > 0) { boolean isValid = ontologyUtil.createIriToAttrMap(result); if (!isValid) { announcer.schedule(new ErrorAnnouncementConfig(appearance.ontologyAttrMatchingFailure())); LOG.log(Level.SEVERE, "ERROR UI's ontology configs do not exist or do not match published ontology!"); } else { createViewTabs(result); } } } }); } @Inject  OntologyHierarchiesPresenterImpl(OntologyHierarchiesViewFactory viewFactory,
                                            OntologyServiceFacade serviceFacade,
                                            EventBus eventBus,
                                            OntologyHierarchiesView.OntologyHierarchiesAppearance appearance); @Override void go(final DETabPanel tabPanel); @Override void setViewDebugId(String baseID); @Override void onAppInfoSelected(final AppInfoSelectedEvent event); @Override void onAppSearchResultLoad(AppSearchResultLoadEvent event); @Override void onOntologyHierarchySelectionChanged(OntologyHierarchySelectionChangedEvent event); @Override void onAppRatingDeselected(AppRatingDeselected event); @Override void onAppRatingSelected(AppRatingSelected event); @Override void onAppFavoriteSelected(AppFavoriteSelectedEvent event); @Override void onDetailsHierarchyClicked(DetailsHierarchyClicked event); @Override void onDetailsCategoryClicked(DetailsCategoryClicked event); @Override HandlerRegistration addOntologyHierarchySelectionChangedEventHandler(
            OntologyHierarchySelectionChangedEvent.OntologyHierarchySelectionChangedEventHandler handler);  }