@Test
        void verifyAccountValidationOnly() throws Throwable {
            val acct = GoogleAuthenticatorAccount.builder()
                .username(UUID.randomUUID().toString())
                .name(UUID.randomUUID().toString())
                .secretKey("secret")
                .validationCode(123456)
                .scratchCodes(List.of())
                .id(RandomUtils.nextLong())
                .build();

            var context = MockRequestContext.create();
            context.setParameter(GoogleAuthenticatorSaveRegistrationAction.REQUEST_PARAMETER_TOKEN, String.valueOf(acct.getValidationCode()));
            context.setParameter(OneTimeTokenAccountSaveRegistrationAction.REQUEST_PARAMETER_ACCOUNT_NAME, acct.getName());
            context.setParameter(OneTimeTokenAccountSaveRegistrationAction.REQUEST_PARAMETER_VALIDATE, "true");
            context.getFlowScope().put(OneTimeTokenAccountCreateRegistrationAction.FLOW_SCOPE_ATTR_ACCOUNT, acct);
            assertEquals(CasWebflowConstants.TRANSITION_ID_SUCCESS, googleSaveAccountRegistrationAction.execute(context).getId());

            context = MockRequestContext.create();
            context.setParameter(GoogleAuthenticatorSaveRegistrationAction.REQUEST_PARAMETER_TOKEN, "987654");
            assertEquals(CasWebflowConstants.TRANSITION_ID_ERROR, googleSaveAccountRegistrationAction.execute(context).getId());
            assertEquals(HttpStatus.UNAUTHORIZED.value(), context.getHttpServletResponse().getStatus());

            context = MockRequestContext.create();
            context.setParameter(GoogleAuthenticatorSaveRegistrationAction.REQUEST_PARAMETER_TOKEN, "112233");
            assertEquals(CasWebflowConstants.TRANSITION_ID_ERROR, googleSaveAccountRegistrationAction.execute(context).getId());
            assertEquals(HttpStatus.UNAUTHORIZED.value(), context.getHttpServletResponse().getStatus());
        }
This is {@link GoogleAuthenticatorSaveRegistrationActionTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-gauth/src/test/java/org/apereo/cas/gauth/web/flow/GoogleAuthenticatorSaveRegistrationActionTests.java