AirshipWebViewClient extends WebViewClient { @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) protected void onAirshipCommand(@NonNull WebView webView, @NonNull String command, @NonNull Uri uri) { } AirshipWebViewClient();  AirshipWebViewClient(@NonNull ActionRunRequestFactory requestFactory); @VisibleForTesting  AirshipWebViewClient(@NonNull NativeBridge nativeBridge); void setActionCompletionCallback(@Nullable ActionCompletionCallback actionCompletionCallback); @CallSuper @Override boolean shouldOverrideUrlLoading(@NonNull WebView webView, @Nullable String url); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) void setFaviconEnabled(boolean enabled); @CallSuper @Override @Nullable WebResourceResponse shouldInterceptRequest(@NonNull WebView webView, @NonNull String url); @CallSuper @Override @SuppressLint("NewApi") @Nullable WebResourceResponse shouldInterceptRequest(@NonNull WebView webView, @NonNull WebResourceRequest request); @CallSuper @Override void onLoadResource(@NonNull WebView webView, @Nullable String url); @Override @CallSuper void onPageFinished(@Nullable final WebView view, final @Nullable String url); @CallSuper @Override void onPageStarted(@NonNull WebView view, @Nullable String url, @Nullable Bitmap favicon); @CallSuper @Override void onReceivedHttpAuthRequest(@NonNull WebView view, @NonNull HttpAuthHandler handler, @Nullable String host,
                                          @Nullable String realm); void addAuthRequestCredentials(@NonNull String expectedAuthHost, @Nullable String username, @Nullable String password); void removeAuthRequestCredentials(@NonNull String expectedAuthHost);  }
@Test public void testOnAirshipCommand() { String url = "uairship: AirshipWebViewClient spy = spy(client); ArgumentCaptor<NativeBridge.CommandDelegate> argument = ArgumentCaptor.forClass(NativeBridge.CommandDelegate.class); when(nativeBridge.onHandleCommand( eq(url), any(JavaScriptExecutor.class), any(ActionRunRequestExtender.class), argument.capture())) .thenReturn(true); spy.shouldOverrideUrlLoading(webView, url); argument.getValue().onAirshipCommand("cool", Uri.parse(url)); verify(spy).onAirshipCommand(webView, "cool", Uri.parse(url)); }