@Override
    @RetryingTest(2)
    void verifySaveAndUpdate() {
        val username = UUID.randomUUID().toString();
        var validationCode = RandomUtils.nextInt(1, 999999);
        val toSave = OneTimeTokenAccount.builder()
            .username(username)
            .secretKey("secret")
            .validationCode(validationCode)
            .scratchCodes(CollectionUtils.wrapList(1, 2, 3, 4, 5, 6))
            .name(UUID.randomUUID().toString())
            .build();
        registry.save(toSave);
        val tokenAccount = registry.get(username).iterator().next();
        assertNotNull(tokenAccount.getRegistrationDate());
        assertEquals(validationCode, tokenAccount.getValidationCode());
        tokenAccount.setSecretKey("newSecret");

        val validationCode2 = RandomUtils.nextInt(1, 999999);
        tokenAccount.setValidationCode(validationCode2);
        registry.update(tokenAccount);

        await().untilAsserted(() -> {
            val s2 = registry.get(username).iterator().next();
            assertEquals(validationCode2, s2.getValidationCode());
            assertEquals("newSecret", s2.getSecretKey());
        });
    }
This is {@link RedisGoogleAuthenticatorTokenCredentialRepositoryTests}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-gauth-redis/src/test/java/org/apereo/cas/gauth/credential/RedisGoogleAuthenticatorTokenCredentialRepositoryTests.java