public static CredentialRegistration getCredentialRegistration(final String username) throws Exception {
        return CredentialRegistration.builder()
            .registrationTime(Instant.now(Clock.systemUTC()))
            .credential(RegisteredCredential.builder()
                .credentialId(ByteArray.fromBase64Url(username))
                .userHandle(ByteArray.fromBase64Url(username))
                .publicKeyCose(ByteArray.fromBase64Url(RandomUtils.randomAlphabetic(8)))
                .build())
            .userIdentity(UserIdentity.builder()
                .name(username)
                .displayName("CAS")
                .id(ByteArray.fromBase64Url(username))
                .build())
            .build();
    }
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