@Test
    void verifyOperation() throws Throwable {
        val callbackUrl = OAuth20Utils.casOAuthCallbackUrl(casProperties.getServer().getPrefix()) + "?client_name=" + oauthCasClient.getName();
        val tgt = new MockTicketGrantingTicket("casuser", RegisteredServiceTestUtils.getTestAttributes());
        ticketRegistry.addTicket(tgt);
        val st = tgt.grantServiceTicket(RegisteredServiceTestUtils.getService(callbackUrl), serviceTicketSessionTrackingPolicy);
        ticketRegistry.addTicket(st);
        ticketRegistry.updateTicket(tgt);

        val registeredService = RegisteredServiceTestUtils.getRegisteredService(callbackUrl, Map.of());
        val releasePolicy = new ReturnAllAttributeReleasePolicy();
        releasePolicy.setAuthorizedToReleaseAuthenticationAttributes(true);
        registeredService.setAttributeReleasePolicy(releasePolicy);
        registeredService.setMatchingStrategy(new LiteralRegisteredServiceMatchingStrategy());
        servicesManager.deleteAll();
        servicesManager.save(registeredService);

        val mockRequest = new MockHttpServletRequest(HttpMethod.GET.name(), CONTEXT + OAuth20Constants.AUTHORIZE_URL);
        mockRequest.setParameter(CasProtocolConstants.PARAMETER_TICKET, st.getId());
        mockRequest.setParameter(CasProtocolConstants.PARAMETER_SERVICE, st.getService().getId());
        mockRequest.addHeader(HttpHeaders.USER_AGENT, "MSIE");
        val mockResponse = new MockHttpServletResponse();
        val callContext = new CallContext(new JEEContext(mockRequest, mockResponse),
            oauthDistributedSessionStore, ProfileManagerFactory.DEFAULT);
        val credentials = oauthCasClient.getCredentials(callContext);
        assertTrue(credentials.isPresent());
        val validated = oauthCasClient.validateCredentials(callContext, credentials.orElseThrow());
        assertTrue(validated.isPresent());
        val profileResult = oauthCasClient.getUserProfile(callContext, validated.orElseThrow());
        assertTrue(profileResult.isPresent());
        val up = (BasicUserProfile) profileResult.get();
        assertTrue(up.containsAttribute(TicketGrantingTicket.class.getName()));
        assertTrue(up.containsAttribute(OAuth20Constants.CAS_OAUTH_STATELESS_PROPERTY));
        assertTrue(up.containsAttribute("uid"));
        assertTrue(up.containsAttribute("givenName"));
        assertTrue(up.containsAttribute("memberOf"));

        assertTrue(up.containsAuthenticationAttribute(CasProtocolConstants.VALIDATION_CAS_MODEL_ATTRIBUTE_NAME_FROM_NEW_LOGIN));
        assertTrue(up.containsAuthenticationAttribute(CasProtocolConstants.VALIDATION_CAS_MODEL_ATTRIBUTE_NAME_AUTHENTICATION_DATE));
        assertTrue(up.containsAuthenticationAttribute(CasProtocolConstants.VALIDATION_REMEMBER_ME_ATTRIBUTE_NAME));
        assertTrue(up.containsAuthenticationAttribute(AuthenticationHandler.SUCCESSFUL_AUTHENTICATION_HANDLERS));
    }
This is {@link CASOAuth20TicketValidatorTests}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-oauth/src/test/java/org/apereo/cas/support/oauth/validator/CASOAuth20TicketValidatorTests.java