BaseOAuthFragment extends Fragment { protected boolean shouldRedirect(String url) { return url.startsWith(getRedirectUri()); }  @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_shouldRedirect() { assertTrue(fragment.shouldRedirect("redirect_url?code=blahblahblah")); }
@Test public void test_shouldNotRedirect() { assertFalse(fragment.shouldRedirect("https: }