@Bean
            public PrincipalResolutionExecutionPlanConfigurer testPrincipalResolutionPlanConfigurer(
                @Qualifier(PrincipalResolver.BEAN_NAME_ATTRIBUTE_REPOSITORY)
                final PersonAttributeDao attributeRepository) {
                return plan -> {
                    val resolver = new EchoingPrincipalResolver() {
                        @Override
                        public Principal resolve(final Credential credential, final Optional<Principal> principal,
                                                 final Optional<AuthenticationHandler> handler,
                                                 final Optional<Service> service) {
                            return FunctionUtils.doUnchecked(() -> {
                                val attributes = attributeRepository.getPerson(credential.getId()).getAttributes();
                                return PrincipalFactoryUtils.newPrincipalFactory().createPrincipal(credential.getId(), attributes);
                            });
                        }

                        @Override
                        public PersonAttributeDao getAttributeRepository() {
                            return attributeRepository;
                        }
                    };
                    plan.registerPrincipalResolver(resolver);
                };
            }
This is {@link BaseCasCoreTests}.

@author Misagh Moayyed
@since 6.0.0
core/cas-server-core/src/test/java/org/apereo/cas/BaseCasCoreTests.java