@Test
    void verifyOperation() throws Throwable {
        val context = MockRequestContext.create(applicationContext);

        val authn = RegisteredServiceTestUtils.getAuthentication(UUID.randomUUID().toString());
        WebUtils.putAuthentication(authn, context);

        webAuthnCredentialRepository.addRegistrationByUsername(authn.getPrincipal().getId(),
            CredentialRegistration.builder()
                .userIdentity(UserIdentity.builder()
                    .name("casuser")
                    .displayName("CAS")
                    .id(ByteArray.fromBase64Url(RandomUtils.randomAlphabetic(8)))
                    .build())
                .credential(RegisteredCredential.builder()
                    .credentialId(ByteArray.fromBase64Url(authn.getPrincipal().getId()))
                    .userHandle(ByteArray.fromBase64Url(RandomUtils.randomAlphabetic(8)))
                    .publicKeyCose(ByteArray.fromBase64Url(RandomUtils.randomAlphabetic(8)))
                    .build())
                .attestationMetadata(Attestation.builder().metadataIdentifier(UUID.randomUUID().toString()).build())
                .registrationTime(Instant.EPOCH)
                .build());

        assertNull(webAuthnDeviceProviderAction.execute(context));
        assertEquals(1, MultifactorAuthenticationWebflowUtils.getMultifactorAuthenticationRegisteredDevices(context).size());
    }
This is {@link WebAuthnMultifactorDeviceProviderActionTests}.

@author Misagh Moayyed
@since 6.6.0
support/cas-server-support-webauthn/src/test/java/org/apereo/cas/webauthn/web/flow/WebAuthnMultifactorDeviceProviderActionTests.java