@Test
    void verifyOperation() throws Throwable {
        val context = MockRequestContext.create(applicationContext);
        MultifactorAuthenticationWebflowUtils.putMultifactorAuthenticationProvider(context, webAuthnMultifactorAuthenticationProvider);
        val authn = RegisteredServiceTestUtils.getAuthentication(USER);
        WebUtils.putAuthentication(authn, context);
        var result = webAuthnStartAuthenticationAction.execute(context);
        assertEquals(CasWebflowConstants.TRANSITION_ID_ERROR, result.getId());

        webAuthnCredentialRepository.addRegistrationByUsername(authn.getPrincipal().getId(),
            CredentialRegistration.builder()
                .credential(RegisteredCredential.builder()
                    .credentialId(ByteArray.fromBase64Url(authn.getPrincipal().getId()))
                    .userHandle(ByteArray.fromBase64Url(RandomUtils.randomAlphabetic(8)))
                    .publicKeyCose(ByteArray.fromBase64Url(RandomUtils.randomAlphabetic(8)))
                    .build())
                .build());
        result = webAuthnStartAuthenticationAction.execute(context);
        assertEquals(CasWebflowConstants.TRANSITION_ID_SUCCESS, result.getId());

        assertTrue(context.getFlowScope().contains("QRCode"));
        assertTrue(context.getFlowScope().contains("QRCodeUri"));
        assertTrue(context.getFlowScope().contains("QRCodeTicket"));
        assertNotNull(WebUtils.getPrincipalFromRequestContext(context));
    }
This is {@link WebAuthnStartAuthenticationActionTests}.

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