GitHubAuthenticatorImpl implements GitHubAuthenticator, OAuthCallback, GitHubAuthenticatorViewImpl.ActionDelegate { @Override public void authorize(@NotNull final AsyncCallback<OAuthStatus> callback) { this.callback = callback; view.showDialog(); } @Inject  GitHubAuthenticatorImpl(SshKeyService sshKeyService,
                                   GitHubAuthenticatorView view,
                                   DialogFactory dialogFactory,
                                   GitHubLocalizationConstant locale,
                                   @RestContext String baseUrl,
                                   DtoUnmarshallerFactory dtoUnmarshallerFactory,
                                   NotificationManager notificationManager,
                                   AppContext appContext); @Override void authorize(@NotNull final AsyncCallback<OAuthStatus> callback); @Override void onCancelled(); @Override void onAccepted(); @Override void onAuthenticated(OAuthStatus authStatus); static final String GITHUB_HOST; }
@Test public void dialogShouldBeShow() throws Exception { AsyncCallback<OAuthStatus> callback = getCallBack(); gitHubAuthenticator.authorize(callback); verify(view).showDialog(); assertThat(gitHubAuthenticator.callback, is(callback)); }