@Test
    void verifyStatelessOperation() {
        val request = new MockHttpServletRequest();
        val response = new MockHttpServletResponse();
        val assertion = mock(Assertion.class);
        when(assertion.isStateless()).thenReturn(Boolean.TRUE);
        when(assertion.getPrimaryAuthentication()).thenReturn(RegisteredServiceTestUtils.getAuthentication());
        val profile = new BasicUserProfile();
        profile.addAttribute(Principal.class.getName(), RegisteredServiceTestUtils.getPrincipal("casuser"));
        profile.addAttribute(OAuth20Constants.CAS_OAUTH_STATELESS_PROPERTY, Boolean.TRUE);
        val context = new JEEContext(request, response);
        val profileManager = new ProfileManager(context, new JEESessionStore());
        profileManager.save(true, profile, false);
        val logic = new OAuth20TicketGrantingTicketAwareSecurityLogic(ticketGrantingTicketCookieGenerator, ticketRegistry);
        assertFalse(logic.loadProfiles(new CallContext(context, new JEESessionStore()), profileManager, List.of()).isEmpty());
        
    }
This is {@link OAuth20TicketGrantingTicketAwareSecurityLogicTests}.

@author Misagh Moayyed
@since 6.5.0
support/cas-server-support-oauth/src/test/java/org/apereo/cas/support/oauth/web/OAuth20TicketGrantingTicketAwareSecurityLogicTests.java