@Test public void testCreatePermanentId() { presenter.setSelectedRequest(mockSelectedRequest); when(mockSelectedRequest.getId()).thenReturn("101010101"); presenter.createPermanentId(); verify(mockPrFacade).createPermanentId(eq(mockSelectedRequest.getId()), stirngCallbackCaptor.capture()); }
@Override public void createPermanentId() { if (selectedRequest != null) { view.mask(I18N.DISPLAY.loadingMask()); prsvc.createPermanentId(selectedRequest.getId(), new AsyncCallback<String>() { @Override public void onFailure(Throwable caught) { view.unmask(); loadPermIdRequests(); IplantAnnouncer.getInstance() .schedule(new ErrorAnnouncementConfig(appearance.createPermIdFailure())); ErrorHandler.post(appearance.createPermIdFailure(), caught); } @Override public void onSuccess(String result) { view.unmask(); IplantAnnouncer.getInstance() .schedule(new SuccessAnnouncementConfig(appearance.createPermIdSucess())); loadPermIdRequests(); } }); } }
PermanentIdRequestPresenter implements Presenter { @Override public void createPermanentId() { if (selectedRequest != null) { view.mask(I18N.DISPLAY.loadingMask()); prsvc.createPermanentId(selectedRequest.getId(), new AsyncCallback<String>() { @Override public void onFailure(Throwable caught) { view.unmask(); loadPermIdRequests(); IplantAnnouncer.getInstance() .schedule(new ErrorAnnouncementConfig(appearance.createPermIdFailure())); ErrorHandler.post(appearance.createPermIdFailure(), caught); } @Override public void onSuccess(String result) { view.unmask(); IplantAnnouncer.getInstance() .schedule(new SuccessAnnouncementConfig(appearance.createPermIdSucess())); loadPermIdRequests(); } }); } } }
PermanentIdRequestPresenter implements Presenter { @Override public void createPermanentId() { if (selectedRequest != null) { view.mask(I18N.DISPLAY.loadingMask()); prsvc.createPermanentId(selectedRequest.getId(), new AsyncCallback<String>() { @Override public void onFailure(Throwable caught) { view.unmask(); loadPermIdRequests(); IplantAnnouncer.getInstance() .schedule(new ErrorAnnouncementConfig(appearance.createPermIdFailure())); ErrorHandler.post(appearance.createPermIdFailure(), caught); } @Override public void onSuccess(String result) { view.unmask(); IplantAnnouncer.getInstance() .schedule(new SuccessAnnouncementConfig(appearance.createPermIdSucess())); loadPermIdRequests(); } }); } } @Inject  PermanentIdRequestPresenter(DiskResourceServiceFacade drsvc,
                                       PermanentIdRequestAdminServiceFacade prsvc,
                                       PermanentIdRequestAutoBeanFactory factory,
                                       PermanentIdRequestView view,
                                       PermanentIdRequestPresenterAppearance appearance); }
PermanentIdRequestPresenter implements Presenter { @Override public void createPermanentId() { if (selectedRequest != null) { view.mask(I18N.DISPLAY.loadingMask()); prsvc.createPermanentId(selectedRequest.getId(), new AsyncCallback<String>() { @Override public void onFailure(Throwable caught) { view.unmask(); loadPermIdRequests(); IplantAnnouncer.getInstance() .schedule(new ErrorAnnouncementConfig(appearance.createPermIdFailure())); ErrorHandler.post(appearance.createPermIdFailure(), caught); } @Override public void onSuccess(String result) { view.unmask(); IplantAnnouncer.getInstance() .schedule(new SuccessAnnouncementConfig(appearance.createPermIdSucess())); loadPermIdRequests(); } }); } } @Inject  PermanentIdRequestPresenter(DiskResourceServiceFacade drsvc,
                                       PermanentIdRequestAdminServiceFacade prsvc,
                                       PermanentIdRequestAutoBeanFactory factory,
                                       PermanentIdRequestView view,
                                       PermanentIdRequestPresenterAppearance appearance); @Override void fetchMetadata(); @Override void setSelectedRequest(PermanentIdRequest request); @Override void go(HasOneWidget container); @Override void getPermIdRequests(); @Override void loadPermIdRequests(); @Override void doUpdateRequest(final PermanentIdRequestUpdate update); @Override void onUpdateRequest(); @Override void createPermanentId(); @Override void getRequestDetails(AsyncCallback<PermanentIdRequestDetails> callback); @Override void setViewDebugId(String baseId); }
PermanentIdRequestPresenter implements Presenter { @Override public void createPermanentId() { if (selectedRequest != null) { view.mask(I18N.DISPLAY.loadingMask()); prsvc.createPermanentId(selectedRequest.getId(), new AsyncCallback<String>() { @Override public void onFailure(Throwable caught) { view.unmask(); loadPermIdRequests(); IplantAnnouncer.getInstance() .schedule(new ErrorAnnouncementConfig(appearance.createPermIdFailure())); ErrorHandler.post(appearance.createPermIdFailure(), caught); } @Override public void onSuccess(String result) { view.unmask(); IplantAnnouncer.getInstance() .schedule(new SuccessAnnouncementConfig(appearance.createPermIdSucess())); loadPermIdRequests(); } }); } } @Inject  PermanentIdRequestPresenter(DiskResourceServiceFacade drsvc,
                                       PermanentIdRequestAdminServiceFacade prsvc,
                                       PermanentIdRequestAutoBeanFactory factory,
                                       PermanentIdRequestView view,
                                       PermanentIdRequestPresenterAppearance appearance); @Override void fetchMetadata(); @Override void setSelectedRequest(PermanentIdRequest request); @Override void go(HasOneWidget container); @Override void getPermIdRequests(); @Override void loadPermIdRequests(); @Override void doUpdateRequest(final PermanentIdRequestUpdate update); @Override void onUpdateRequest(); @Override void createPermanentId(); @Override void getRequestDetails(AsyncCallback<PermanentIdRequestDetails> callback); @Override void setViewDebugId(String baseId);  }