@Bean
        public TicketValidator tokenTicketValidator() throws Throwable {
            val validator = mock(TicketValidator.class);
            val principal = PrincipalFactoryUtils.newPrincipalFactory().createPrincipal("casuser",
                CollectionUtils.wrap("name", List.of("value"),
                    ProtocolAttributeEncoder.encodeAttribute("custom:name"), CollectionUtils.wrapList("custom:value")));
            when(validator.validate(anyString(), anyString()))
                .thenReturn(TicketValidationResult.builder().principal(principal).build());
            return validator;

        }
This is {@link BaseJwtTokenTicketBuilderTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-token-core/src/test/java/org/apereo/cas/token/BaseJwtTokenTicketBuilderTests.java