@Test public void testUpdateBetaStatus_AddBeta() { when(appMock.isBeta()).thenReturn(true); uut.updateBetaStatus(appMock); verify(ontologyUtilMock).getBetaAvuList(); verify(ontologyServiceFacadeMock).addAVUsToApp(eq(appMock), eq(avuListMock), avuListCallbackCaptor.capture()); avuListCallbackCaptor.getValue().onSuccess(listAvuMock); verify(announcerMock).schedule(isA(SuccessAnnouncementConfig.class)); verify(appMock).setBeta(anyBoolean()); verify(listStoreMock).update(eq(appMock)); }
public void updateBetaStatus(final App app) { Preconditions.checkNotNull(app); if (app.isBeta()) { AvuList betaAvus = ontologyUtil.getBetaAvuList(); ontologyServiceFacade.addAVUsToApp(app, betaAvus, new AddBetaAvuCallback(app)); } else { ontologyServiceFacade.getAppAVUs(app, new AsyncCallback<List<Avu>>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); } @Override public void onSuccess(List<Avu> result) { AvuList avuList = ontologyUtil.removeBetaAvu(result); ontologyServiceFacade.setAppAVUs(app, avuList, new RemoveBetaAvuCallback(app)); } }); } }
AdminAppsGridPresenterImpl implements AdminAppsGridView.Presenter,
                                                   AppInfoSelectedEvent.AppInfoSelectedEventHandler,
                                                   SaveAppSelected.SaveAppSelectedHandler { public void updateBetaStatus(final App app) { Preconditions.checkNotNull(app); if (app.isBeta()) { AvuList betaAvus = ontologyUtil.getBetaAvuList(); ontologyServiceFacade.addAVUsToApp(app, betaAvus, new AddBetaAvuCallback(app)); } else { ontologyServiceFacade.getAppAVUs(app, new AsyncCallback<List<Avu>>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); } @Override public void onSuccess(List<Avu> result) { AvuList avuList = ontologyUtil.removeBetaAvu(result); ontologyServiceFacade.setAppAVUs(app, avuList, new RemoveBetaAvuCallback(app)); } }); } } }
AdminAppsGridPresenterImpl implements AdminAppsGridView.Presenter,
                                                   AppInfoSelectedEvent.AppInfoSelectedEventHandler,
                                                   SaveAppSelected.SaveAppSelectedHandler { public void updateBetaStatus(final App app) { Preconditions.checkNotNull(app); if (app.isBeta()) { AvuList betaAvus = ontologyUtil.getBetaAvuList(); ontologyServiceFacade.addAVUsToApp(app, betaAvus, new AddBetaAvuCallback(app)); } else { ontologyServiceFacade.getAppAVUs(app, new AsyncCallback<List<Avu>>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); } @Override public void onSuccess(List<Avu> result) { AvuList avuList = ontologyUtil.removeBetaAvu(result); ontologyServiceFacade.setAppAVUs(app, avuList, new RemoveBetaAvuCallback(app)); } }); } } @Inject  AdminAppsGridPresenterImpl(final AdminAppsGridViewFactory viewFactory,
                               final ListStore<App> listStore); }
AdminAppsGridPresenterImpl implements AdminAppsGridView.Presenter,
                                                   AppInfoSelectedEvent.AppInfoSelectedEventHandler,
                                                   SaveAppSelected.SaveAppSelectedHandler { public void updateBetaStatus(final App app) { Preconditions.checkNotNull(app); if (app.isBeta()) { AvuList betaAvus = ontologyUtil.getBetaAvuList(); ontologyServiceFacade.addAVUsToApp(app, betaAvus, new AddBetaAvuCallback(app)); } else { ontologyServiceFacade.getAppAVUs(app, new AsyncCallback<List<Avu>>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); } @Override public void onSuccess(List<Avu> result) { AvuList avuList = ontologyUtil.removeBetaAvu(result); ontologyServiceFacade.setAppAVUs(app, avuList, new RemoveBetaAvuCallback(app)); } }); } } @Inject  AdminAppsGridPresenterImpl(final AdminAppsGridViewFactory viewFactory,
                               final ListStore<App> listStore); @Override HandlerRegistration addStoreRemoveHandler(StoreRemoveEvent.StoreRemoveHandler<App> handler); @Override void fireEvent(GwtEvent<?> event); @Override AdminAppsGridView getView(); @Override App getAppFromElement(Element eventTarget); @Override List<App> getSelectedApps(); @Override void onAppCategorySelectionChanged(AppCategorySelectionChangedEvent event); @Override void onAppInfoSelected(final AppInfoSelectedEvent event); @Override void onAppSearchResultLoad(AppSearchResultLoadEvent event); @Override void onDeleteAppsSelected(final DeleteAppsSelected event); @Override void onRestoreAppSelected(final RestoreAppSelected event); @Override void onSaveAppSelected(SaveAppSelected event); void updateBetaStatus(final App app); }
AdminAppsGridPresenterImpl implements AdminAppsGridView.Presenter,
                                                   AppInfoSelectedEvent.AppInfoSelectedEventHandler,
                                                   SaveAppSelected.SaveAppSelectedHandler { public void updateBetaStatus(final App app) { Preconditions.checkNotNull(app); if (app.isBeta()) { AvuList betaAvus = ontologyUtil.getBetaAvuList(); ontologyServiceFacade.addAVUsToApp(app, betaAvus, new AddBetaAvuCallback(app)); } else { ontologyServiceFacade.getAppAVUs(app, new AsyncCallback<List<Avu>>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); } @Override public void onSuccess(List<Avu> result) { AvuList avuList = ontologyUtil.removeBetaAvu(result); ontologyServiceFacade.setAppAVUs(app, avuList, new RemoveBetaAvuCallback(app)); } }); } } @Inject  AdminAppsGridPresenterImpl(final AdminAppsGridViewFactory viewFactory,
                               final ListStore<App> listStore); @Override HandlerRegistration addStoreRemoveHandler(StoreRemoveEvent.StoreRemoveHandler<App> handler); @Override void fireEvent(GwtEvent<?> event); @Override AdminAppsGridView getView(); @Override App getAppFromElement(Element eventTarget); @Override List<App> getSelectedApps(); @Override void onAppCategorySelectionChanged(AppCategorySelectionChangedEvent event); @Override void onAppInfoSelected(final AppInfoSelectedEvent event); @Override void onAppSearchResultLoad(AppSearchResultLoadEvent event); @Override void onDeleteAppsSelected(final DeleteAppsSelected event); @Override void onRestoreAppSelected(final RestoreAppSelected event); @Override void onSaveAppSelected(SaveAppSelected event); void updateBetaStatus(final App app);  }