private OAuth20AccessToken createAccessToken(
        final TicketGrantingTicket ticketGrantingTicket,
        final OAuthRegisteredService registeredService) throws Throwable {
        return defaultAccessTokenFactory.create(
            RegisteredServiceTestUtils.getService(registeredService.getServiceId()),
            RegisteredServiceTestUtils.getAuthentication(),
            ticketGrantingTicket,
            Set.of("Scope1", "Scope2"), null, registeredService.getClientId(), Map.of(),
            OAuth20ResponseTypes.CODE, OAuth20GrantTypes.AUTHORIZATION_CODE);
    }
This is {@link OAuth20DefaultAccessTokenFactoryTests}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-oauth/src/test/java/org/apereo/cas/ticket/accesstoken/OAuth20DefaultAccessTokenFactoryTests.java