OAuthController implements OAuthWebViewClient.Listener { @Override public void onSuccess(Bundle bundle) { handleWebViewSuccess(bundle); dismissWebView(); } OAuthController(ProgressBar spinner, WebView webView, TwitterAuthConfig authConfig,
            OAuth1aService oAuth1aService, Listener listener); @Override void onPageFinished(WebView webView, String url); @Override void onSuccess(Bundle bundle); @Override void onError(WebViewException exception);  }
@Test public void testOnSuccess_bundleIncomplete() { controller.onSuccess(Bundle.EMPTY); verifyOnCompleteWithError("Failed to get authorization, bundle incomplete"); verify(mockWebView).stopLoading(); }
@Test public void testOnSuccess() { final Bundle bundle = new Bundle(); bundle.putString(OAuthConstants.PARAM_VERIFIER, TEST_VERIFIER_VALUE); controller.onSuccess(bundle); verify(mockOAuth1aService).requestAccessToken(any(Callback.class), eq(controller.requestToken), eq(TEST_VERIFIER_VALUE)); verify(mockWebView).stopLoading(); }
@Test public void testOnSuccess_bundleNull() { controller.onSuccess(null); verifyOnCompleteWithError("Failed to get authorization, bundle incomplete"); verify(mockWebView).stopLoading(); }