private Principal mergeAndResolve(final Principal principal, final Credential credential,
                                      final PrincipalResolver resolver1, final PrincipalResolver resolver2,
                                      final PrincipalAttributesCoreProperties.MergingStrategyTypes mergerType) throws Throwable {
        val props = new CasConfigurationProperties();
        props
            .getAuthn()
            .getAttributeRepository()
            .getCore()
            .setMerger(mergerType);
        val resolver = buildResolver(List.of(resolver1, resolver2), props);

        return resolver.resolve(credential,
            Optional.of(principal),
            Optional.of(new SimpleTestUsernamePasswordAuthenticationHandler()),
            Optional.of(CoreAuthenticationTestUtils.getService()));
    }
Unit test for {@link ChainingPrincipalResolver}.

@author Marvin S. Addison
@since 4.0.0
core/cas-server-core-authentication/src/test/java/org/apereo/cas/authentication/principal/ChainingPrincipalResolverTests.java