BaseOAuthFragment extends Fragment { public void startLogin() { loginWebView.loadUrl(buildLoginUrl()); }  @Override View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle savedInstanceState); WebViewClient getWebViewClient(); TokenGet getTokenAsyncTask(String authCode); @Override void onStart(); void superOnStart(); void startLogin(); String buildLoginUrl(); void finishAuthorization(); abstract String getLoginUrl(); abstract String getScope(); abstract String getTokenUrl(); abstract String getClientId(); abstract String getClientSecret(); abstract String getRedirectUri(); abstract String getGrantType(); abstract void saveAuthToken(String authToken, long expire, String refreshToken, String userId); public WebView loginWebView; }
@Test public void test_startLogin() { fragment.loginWebView = Mockito.spy(fragment.loginWebView); fragment.startLogin(); verify(fragment.loginWebView).loadUrl(anyString()); }