OAuthWebViewClient extends WebViewClient { @Override public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { super.onReceivedError(view, errorCode, description, failingUrl); listener.onError(new WebViewException(errorCode, description, failingUrl)); } OAuthWebViewClient(String completeUrl, Listener listener); @Override void onPageFinished(WebView view, String url); @Override boolean shouldOverrideUrlLoading(WebView view, String url); @Override void onReceivedError(WebView view, int errorCode,
            String description, String failingUrl); @Override void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error);  }
@Test public void testOnReceivedError() { webViewClient.onReceivedError(mock(WebView.class), TEST_ERROR_CODE, TEST_ERROR_DESC, TEST_URL); verifyOnError(TEST_ERROR_CODE, TEST_ERROR_DESC, TEST_URL); }