### Question:
AuthorizeRequest extends WebRequest { @Override public String persist() { mParameters.request_type = "authorize"; return new Gson().toJson(mParameters); } AuthorizeRequest(Parameters parameters); @Override String getState(); String getCodeVerifier(); String getNonce(); String getMaxAge(); @Override @NonNull Uri toUri(); @NonNull String getKey(); @Override String persist(); static final String IDP_SCOPE; static final String IDP; static final String LOGIN_HINT; static final String STATE; }### Answer:
@Test public void testBuilder() throws AuthorizationException { AuthorizeRequest request = new AuthorizeRequest.Builder() .authorizeEndpoint(mConfig.getDiscoveryUri().toString()) .redirectUri(mConfig.getRedirectUri().toString()) .scope(SCOPES) .authenticationPayload(new AuthenticationPayload.Builder() .setState(CUSTOM_STATE) .setLoginHint(LOGIN_HINT) .build()) .clientId(CLIENT_ID) .providerConfiguration(mProviderConfig) .setDisplay(PROMPT) .nonce(CUSTOM_NONCE) .codeVerifier(mCodeVerifier) .maxAge(EXPIRES_IN) .create(); assertEquals(request.persist(), mRequest.persist()); }
@Test public void persist() { String json = mRequest.persist(); AuthorizeRequest.Parameters parameters = new Gson().fromJson(json, AuthorizeRequest.Parameters.class); AuthorizeRequest request = new AuthorizeRequest(parameters); assertEquals(request.persist(), json); }