@Override
        public Optional<Credentials> validate(final CallContext ctx, final Credentials credentials) {
            UserProfile profile = new CommonProfile();
            profile.setId(((UsernamePasswordCredentials) credentials).getUsername());
            credentials.setUserProfile(profile);
            return Optional.of(credentials);
        }
Test cases for {@link LocalCachingAuthenticator}.

@author Misagh Moayyed
@since 1.8
pac4j-core/src/test/java/org/pac4j/core/credentials/authenticator/LocalCachingAuthenticatorTests.java