@BeforeEach
    void initialize() throws Exception {
        val servicesManager = mock(ServicesManager.class);
        googleAuthenticator = new DefaultCasGoogleAuthenticator(casProperties, tenantExtractor);
        tokenRepository = new CachingOneTimeTokenRepository(Caffeine.newBuilder().initialCapacity(10).build(s -> null));
        tokenCredentialRepository = new InMemoryGoogleAuthenticatorTokenCredentialRepository(
            CipherExecutor.noOpOfStringToString(), CipherExecutor.noOpOfNumberToNumber(), googleAuthenticator);
        googleAuthenticator.setCredentialRepository(new DummyCredentialRepository());
        handler = new GoogleAuthenticatorAuthenticationHandler("GAuth",
            servicesManager,
            PrincipalFactoryUtils.newPrincipalFactory(),
            new GoogleAuthenticatorOneTimeTokenCredentialValidator(googleAuthenticator, tokenRepository, tokenCredentialRepository),
            null, new DirectObjectProvider<>(mock(MultifactorAuthenticationProvider.class)));

        val context = MockRequestContext.create().setClientInfo();
        WebUtils.putAuthentication(RegisteredServiceTestUtils.getAuthentication("casuser"), context);
    }
This is {@link GoogleAuthenticatorAuthenticationHandlerTests}.

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