@Test(expected=CredentialsException.class)
    public void testValidateAndNoCacheSwitchDelegate() {
        val authenticator = new
                LocalCachingAuthenticator(this.delegate, 10, 2, TimeUnit.MINUTES);
        authenticator.init();
        authenticator.validate(null, this.credentials);
        assertTrue(authenticator.isCached(this.credentials));
        authenticator.setDelegate(new ThrowingAuthenticator());
        authenticator.removeFromCache(this.credentials);
        authenticator.validate(null, this.credentials);
    }
Test cases for {@link LocalCachingAuthenticator}.

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