@BeforeEach
    void initialize() {
        service = new OAuthRegisteredService();
        service.setName("OAuth");
        service.setId(RandomUtils.nextLong());
        service.setServiceId("https://www.example.org");
        service.setClientSecret("secret");
        service.setClientId("client");

        serviceWithoutSecret = new OAuthRegisteredService();
        serviceWithoutSecret.setName("OAuth2");
        serviceWithoutSecret.setId(RandomUtils.nextLong());
        serviceWithoutSecret.setServiceId("https://www.example2.org");
        serviceWithoutSecret.setClientId("clientWithoutSecret");

        serviceWithoutSecret2 = new OAuthRegisteredService();
        serviceWithoutSecret2.setName("OAuth3");
        serviceWithoutSecret2.setId(RandomUtils.nextLong());
        serviceWithoutSecret2.setServiceId("https://www.example3org");
        serviceWithoutSecret2.setClientId("clientWithoutSecret2");

        serviceJwtAccessToken = new OAuthRegisteredService();
        serviceJwtAccessToken.setName("The registered service name");
        serviceJwtAccessToken.setServiceId("https://oauth.jwt.service");
        serviceJwtAccessToken.setClientId("clientid");
        serviceJwtAccessToken.setId(RandomUtils.nextLong());
        serviceJwtAccessToken.setClientSecret("clientsecret");
        serviceJwtAccessToken.setAttributeReleasePolicy(new ReturnAllAttributeReleasePolicy());
        serviceJwtAccessToken.setJwtAccessToken(true);

        serviceWithAttributesMapping = new OAuthRegisteredService();
        serviceWithAttributesMapping.setName("OAuth5");
        serviceWithAttributesMapping.setId(RandomUtils.nextLong());
        serviceWithAttributesMapping.setServiceId("https://www.example5.org");
        serviceWithAttributesMapping.setClientSecret("secret");
        serviceWithAttributesMapping.setClientId("serviceWithAttributesMapping");

        val provider = new DefaultRegisteredServiceUsernameProvider();
        provider.setCanonicalizationMode("LOWER");
        serviceWithAttributesMapping.setUsernameAttributeProvider(provider);
        serviceWithAttributesMapping.setAttributeReleasePolicy(
            new ReturnAllowedAttributeReleasePolicy(List.of("eduPersonAffiliation")));

        servicesManager.save(service, serviceWithoutSecret, serviceWithoutSecret2, serviceJwtAccessToken, serviceWithAttributesMapping);
    }
This is {@link BaseOAuth20AuthenticatorTests}.

@author Misagh Moayyed
@since 6.0.0
support/cas-server-support-oauth/src/test/java/org/apereo/cas/support/oauth/authenticator/BaseOAuth20AuthenticatorTests.java