### Question:
SyncSessionClientImpl implements SyncSessionClient { RefreshTokenRequest refreshTokenRequest(ProviderConfiguration providerConfiguration, TokenResponse tokenResponse) throws AuthorizationException { return HttpRequestBuilder.newRefreshTokenRequest() .tokenResponse(tokenResponse) .providerConfiguration(providerConfiguration) .config(mOidcConfig) .createRequest(); } SyncSessionClientImpl(OIDCConfig oidcConfig, OktaState oktaState,
                          OktaHttpClient httpClient); JSONObject authorizedRequest(@NonNull Uri uri,
                                        @Nullable Map<String, String> properties,
                                        @Nullable Map<String, String> postParameters,
                                        @NonNull ConnectionParameters.RequestMethod method); @Override UserInfo getUserProfile(); @Override IntrospectInfo introspectToken(String token, String tokenType); @Override Boolean revokeToken(String token); @Override Tokens refreshToken(); @Override Tokens getTokens(); @Override boolean isAuthenticated(); @Override void clear(); @Override void cancel(); @Override void migrateTo(EncryptionManager manager);  }### Answer:
@Test public void refreshTokenRequest() throws InterruptedException, JSONException, AuthorizationException, OktaRepository.EncryptionException { mOktaState.save(mTokenResponse); RefreshTokenRequest request = mSyncSessionClientImpl.refreshTokenRequest(mOktaState.getProviderConfiguration(), mTokenResponse); String nonce = CodeVerifierUtil.generateRandomState(); String jws = TestValues.getJwt(mEndPoint.getUrl(), nonce, mConfig.getClientId()); mEndPoint.enqueueTokenSuccess(jws); TokenResponse response = request.executeRequest(mHttpClient); assertNotNull(response); TokenResponse original = mGson.fromJson(String.format(TOKEN_SUCCESS, jws), TokenResponse.class); assertEquals(original.getIdToken(), response.getIdToken()); assertEquals(original.getRefreshToken(), response.getRefreshToken()); assertEquals(original.getIdToken(), response.getIdToken()); }
@Test public void refreshTokenRequestFailure() throws InterruptedException, JSONException, AuthorizationException, OktaRepository.EncryptionException { mOktaState.save(mTokenResponse); mExpectedEx.expect(AuthorizationException.class); mEndPoint.enqueueReturnInvalidClient(); RefreshTokenRequest request = mSyncSessionClientImpl.refreshTokenRequest(mOktaState.getProviderConfiguration(), mTokenResponse); TokenResponse response = request.executeRequest(mHttpClient); assertNull(response); }