### Question:
ProviderConfiguration implements Persistable { void validate(boolean isOAuth2) throws IllegalArgumentException { if (TextUtils.isEmpty(authorization_endpoint)) { throw new IllegalArgumentException("authorization_endpoint is missing"); } if (TextUtils.isEmpty(end_session_endpoint)) { throw new IllegalArgumentException("end_session_endpoint is missing"); } if (TextUtils.isEmpty(introspection_endpoint)) { throw new IllegalArgumentException("introspection_endpoint is missing"); } if (TextUtils.isEmpty(issuer)) { throw new IllegalArgumentException("issuer is missing"); } if (TextUtils.isEmpty(jwks_uri)) { throw new IllegalArgumentException("jwks_uri is missing"); } if (TextUtils.isEmpty(registration_endpoint)) { throw new IllegalArgumentException("registration_endpoint is missing"); } if (TextUtils.isEmpty(revocation_endpoint)) { throw new IllegalArgumentException("revocation_endpoint is missing"); } if (TextUtils.isEmpty(token_endpoint)) { throw new IllegalArgumentException("token_endpoint is missing"); } if (!isOAuth2 && TextUtils.isEmpty(userinfo_endpoint)) { throw new IllegalArgumentException("userinfo_endpoint is missing"); } } @VisibleForTesting  ProviderConfiguration();  ProviderConfiguration(CustomConfiguration config); @NonNull @Override String getKey(); @Override String persist(); static final String OPENID_CONFIGURATION_RESOURCE; static final String OAUTH2_CONFIGURATION_RESOURCE; public String authorization_endpoint; public String[] claims_supported; public String[] code_challenge_methods_supported; public String end_session_endpoint; public String[] grant_types_supported; public String introspection_endpoint; public String[] introspection_endpoint_auth_methods_supported; public String issuer; public String jwks_uri; public String registration_endpoint; public String[] request_object_signing_alg_values_supported; public boolean request_parameter_supported; public String[] response_modes_supported; public String[] response_types_supported; public String revocation_endpoint; public String[] revocation_endpoint_auth_methods_supported; public String[] scopes_supported; public String[] subject_types_supported; public String token_endpoint; public String[] token_endpoint_auth_methods_supported; public String userinfo_endpoint; public String[] id_token_signing_alg_values_supported; static final Persistable.Restore<ProviderConfiguration> RESTORE; }### Answer:
@Test public void validate() throws IllegalArgumentException { mValidConfiguration.validate(false); mValidOAuth2Configuration.validate(true); }
@Test public void validateFail() throws IllegalArgumentException { mExpectedEx.expect(IllegalArgumentException.class); mInvalidConfiguration.validate(false); }
@Test public void validateMissingUserInfo() throws IllegalArgumentException { mExpectedEx.expect(IllegalArgumentException.class); mValidOAuth2Configuration.validate(false); }