@Test
    protected void verifyOperation() throws Throwable {
        val id = getUsername();
        val registration = getCredentialRegistration(id.toLowerCase(Locale.ENGLISH));

        assertTrue(webAuthnCredentialRepository.addRegistrationByUsername(id.toLowerCase(Locale.ENGLISH), registration));
        assertFalse(webAuthnCredentialRepository.getCredentialIdsForUsername(id.toUpperCase(Locale.ENGLISH)).isEmpty());

        val ba = ByteArray.fromBase64Url(id);
        val newRegistration = webAuthnCredentialRepository.getRegistrationByUsernameAndCredentialId(id.toUpperCase(Locale.ENGLISH), ba);
        assertTrue(newRegistration.isPresent());
        assertNotNull(newRegistration.get().getRegistrationTime());
        assertFalse(webAuthnCredentialRepository.getRegistrationsByUserHandle(ba).isEmpty());
        assertFalse(webAuthnCredentialRepository.getRegistrationsByUsername(id.toUpperCase(Locale.ENGLISH)).isEmpty());
        assertFalse(webAuthnCredentialRepository.getUserHandleForUsername(id.toUpperCase(Locale.ENGLISH)).isEmpty());
        assertFalse(webAuthnCredentialRepository.getUsernameForUserHandle(ba).isEmpty());
        assertFalse(webAuthnCredentialRepository.lookup(ba, ba).isEmpty());
        assertFalse(webAuthnCredentialRepository.lookupAll(ba).isEmpty());
        assertTrue(webAuthnCredentialRepository.stream().findAny().isPresent());

        val credential = RegisteredCredential.builder()
            .credentialId(ba)
            .userHandle(ByteArray.fromBase64Url(RandomUtils.randomAlphabetic(8)))
            .publicKeyCose(ByteArray.fromBase64Url(RandomUtils.randomAlphabetic(8)))
            .build();

        val result = mock(AssertionResult.class);
        when(result.getCredential()).thenReturn(credential);
        when(result.getSignatureCount()).thenReturn(1L);
        when(result.getUsername()).thenReturn(id);
        when(result.getCredentialId()).thenReturn(ba);

        webAuthnCredentialRepository.updateSignatureCount(result);

        webAuthnCredentialRepository.removeAllRegistrations(id.toUpperCase(Locale.ENGLISH));
        webAuthnCredentialRepository.removeRegistrationByUsername(id.toUpperCase(Locale.ENGLISH), registration);
        assertTrue(webAuthnCredentialRepository.lookup(ba, ba).isEmpty());

        assertDoesNotThrow(() -> webAuthnCredentialRepository.clean());
    }
This is {@link BaseWebAuthnCredentialRepositoryTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-webauthn/src/test/java/org/apereo/cas/webauthn/storage/BaseWebAuthnCredentialRepositoryTests.java