@Test public void testFailedRefreshKeysAfterSuccessfulUploadKey() { Array<KeyItem> keyItemArray = new JsonArrayListAdapter<KeyItem>(new ArrayList<KeyItem>()); presenter.onUploadClicked(); verify(uploadSshKeyPresenter).showDialog(asyncCallbackCaptor.capture()); AsyncCallback<Void> asyncCallback = asyncCallbackCaptor.getValue(); asyncCallback.onSuccess(null); verify(service).getAllKeys(getAllKeysCallbackCaptor.capture()); AsyncRequestCallback<Array<KeyItem>> getAllKeysCallback = getAllKeysCallbackCaptor.getValue(); GwtReflectionUtils.callOnFailure(getAllKeysCallback, new Exception("")); verify(loader).hide(anyString()); verify(view, never()).setKeys(eq(keyItemArray)); verify(eventBus).fireEvent(Matchers.<ExceptionThrownEvent>anyObject()); }
@Override public void onUploadClicked() { uploadSshKeyPresenter.showDialog(new AsyncCallback<Void>() { @Override public void onSuccess(Void result) { refreshKeys(); } @Override public void onFailure(Throwable caught) { } }); }
SshKeyManagerPresenter extends AbstractPreferencePagePresenter implements SshKeyManagerView.ActionDelegate { @Override public void onUploadClicked() { uploadSshKeyPresenter.showDialog(new AsyncCallback<Void>() { @Override public void onSuccess(Void result) { refreshKeys(); } @Override public void onFailure(Throwable caught) { } }); } }
SshKeyManagerPresenter extends AbstractPreferencePagePresenter implements SshKeyManagerView.ActionDelegate { @Override public void onUploadClicked() { uploadSshKeyPresenter.showDialog(new AsyncCallback<Void>() { @Override public void onSuccess(Void result) { refreshKeys(); } @Override public void onFailure(Throwable caught) { } }); } @Inject  SshKeyManagerPresenter(SshKeyManagerView view,
                                  SshKeyService service,
                                  SshResources resources,
                                  AppContext appContext,
                                  SshLocalizationConstant constant,
                                  EventBus eventBus,
                                  AsyncRequestLoader loader,
                                  UploadSshKeyPresenter uploadSshKeyPresenter,
                                  NotificationManager notificationManager,
                                  DtoUnmarshallerFactory dtoUnmarshallerFactory,
                                  DialogFactory dialogFactory); }
SshKeyManagerPresenter extends AbstractPreferencePagePresenter implements SshKeyManagerView.ActionDelegate { @Override public void onUploadClicked() { uploadSshKeyPresenter.showDialog(new AsyncCallback<Void>() { @Override public void onSuccess(Void result) { refreshKeys(); } @Override public void onFailure(Throwable caught) { } }); } @Inject  SshKeyManagerPresenter(SshKeyManagerView view,
                                  SshKeyService service,
                                  SshResources resources,
                                  AppContext appContext,
                                  SshLocalizationConstant constant,
                                  EventBus eventBus,
                                  AsyncRequestLoader loader,
                                  UploadSshKeyPresenter uploadSshKeyPresenter,
                                  NotificationManager notificationManager,
                                  DtoUnmarshallerFactory dtoUnmarshallerFactory,
                                  DialogFactory dialogFactory); @Override void onViewClicked(@Nonnull final KeyItem key); @Override void onDeleteClicked(@Nonnull final KeyItem key); @Override void onGenerateClicked(); @Override void onUploadClicked(); @Override void onGenerateGithubKeyClicked(); @Override boolean isDirty(); @Override void go(AcceptsOneWidget container); @Override void storeChanges(); @Override void revertChanges(); }
SshKeyManagerPresenter extends AbstractPreferencePagePresenter implements SshKeyManagerView.ActionDelegate { @Override public void onUploadClicked() { uploadSshKeyPresenter.showDialog(new AsyncCallback<Void>() { @Override public void onSuccess(Void result) { refreshKeys(); } @Override public void onFailure(Throwable caught) { } }); } @Inject  SshKeyManagerPresenter(SshKeyManagerView view,
                                  SshKeyService service,
                                  SshResources resources,
                                  AppContext appContext,
                                  SshLocalizationConstant constant,
                                  EventBus eventBus,
                                  AsyncRequestLoader loader,
                                  UploadSshKeyPresenter uploadSshKeyPresenter,
                                  NotificationManager notificationManager,
                                  DtoUnmarshallerFactory dtoUnmarshallerFactory,
                                  DialogFactory dialogFactory); @Override void onViewClicked(@Nonnull final KeyItem key); @Override void onDeleteClicked(@Nonnull final KeyItem key); @Override void onGenerateClicked(); @Override void onUploadClicked(); @Override void onGenerateGithubKeyClicked(); @Override boolean isDirty(); @Override void go(AcceptsOneWidget container); @Override void storeChanges(); @Override void revertChanges(); static final String GITHUB_HOST; }