@Test
        void verifyCustomizedRefreshTokenWithNullAuthentication() throws Throwable {
            val registeredService = getRegisteredService(UUID.randomUUID().toString(), "secret", new LinkedHashSet<>());
            servicesManager.save(registeredService);
            val service = RegisteredServiceTestUtils.getService(SERVICE_URL);

            val mockRequest = new MockHttpServletRequest(HttpMethod.GET.name(), CONTEXT + OAuth20Constants.ACCESS_TOKEN_URL);
            val mockResponse = new MockHttpServletResponse();

            val holder = AccessTokenRequestContext.builder()
                .clientId(registeredService.getClientId())
                .service(service)
                .authentication(null)
                .registeredService(registeredService)
                .grantType(OAuth20GrantTypes.AUTHORIZATION_CODE)
                .responseType(OAuth20ResponseTypes.CODE)
                .ticketGrantingTicket(new MockTicketGrantingTicket("casuser"))
                .claims(oauthRequestParameterResolver.resolveRequestClaims(new JEEContext(mockRequest, mockResponse)))
                .build();

            val generatedToken = ((OAuth20DefaultTokenGenerator) oauthTokenGenerator).generateAccessTokenOAuthGrantTypes(holder);
            assertNotNull(generatedToken);
        }
This is {@link OAuth20DefaultTokenGeneratorTests}.

@author Misagh Moayyed
@since 6.1.0
support/cas-server-support-oauth/src/test/java/org/apereo/cas/support/oauth/web/response/accesstoken/OAuth20DefaultTokenGeneratorTests.java