public static AuthenticationResult getAuthenticationResult(final String username) {
        return FunctionUtils.doUnchecked(() -> {
            val authentication = getAuthentication(username);
            val strategy = mock(PrincipalElectionStrategy.class);
            when(strategy.getAttributeMerger()).thenReturn(new MultivaluedAttributeMerger());
            when(strategy.nominate(anyCollection(), anyMap())).thenReturn(authentication.getPrincipal());
            return new DefaultAuthenticationResultBuilder(strategy).collect(authentication).build();
        });
    }
Gets authentication result.

@return the authentication result
core/cas-server-core-services/src/test/java/org/apereo/cas/services/RegisteredServiceTestUtils.java