@Test
    void verifySaveAndUpdate() throws Throwable {
        val casuser = getUsernameUnderTest();
        val acct = getAccount("verifySaveAndUpdate", casuser);
        acct.setProperties(CollectionUtils.wrapList("prop1", "prop2"));
        val repo = getRegistry("verifySaveAndUpdate");
        var toSave = OneTimeTokenAccount.builder()
            .username(acct.getUsername())
            .secretKey(acct.getSecretKey())
            .validationCode(acct.getValidationCode())
            .scratchCodes(acct.getScratchCodes())
            .name(casuser)
            .build();
        repo.save(toSave);
        var account = repo.get(acct.getUsername()).iterator().next();
        assertNotNull(account, "Account not found");
        assertNotNull(account.getRegistrationDate());
        assertEquals(acct.getValidationCode(), account.getValidationCode());
        assertEquals(acct.getSecretKey(), account.getSecretKey());
        account.setSecretKey("newSecret");
        account.setValidationCode(999666);
        repo.update(account);
        val accts = repo.get(casuser);
        account = accts.iterator().next();
        assertEquals(999666, account.getValidationCode());
        assertEquals("newSecret", account.getSecretKey());

        repo.delete(account.getId());
        assertNull(repo.get(account.getId()));
    }
This is {@link BaseOneTimeTokenCredentialRepositoryTests}.

@author Timur Duehr
@since 6.0.0
support/cas-server-support-gauth/src/test/java/org/apereo/cas/gauth/credential/BaseOneTimeTokenCredentialRepositoryTests.java