private TransientSessionTicket getQRCodeTicket(final MockRequestContext context, final Authentication authentication) throws Exception {
        WebUtils.putAuthentication(authentication, context);
        MultifactorAuthenticationWebflowUtils.putMultifactorAuthenticationProvider(context, webAuthnMultifactorAuthenticationProvider);
        webAuthnCredentialRepository.addRegistrationByUsername(authentication.getPrincipal().getId(),
            CredentialRegistration.builder()
                .userIdentity(UserIdentity.builder()
                    .name(authentication.getPrincipal().getId())
                    .displayName("CAS")
                    .id(ByteArray.fromBase64Url(authentication.getPrincipal().getId()))
                    .build())
                .registrationTime(Instant.now(Clock.systemUTC()))
                .credential(RegisteredCredential.builder()
                    .credentialId(ByteArray.fromBase64Url(authentication.getPrincipal().getId()))
                    .userHandle(ByteArray.fromBase64Url(RandomUtils.randomAlphabetic(8)))
                    .publicKeyCose(ByteArray.fromBase64Url(RandomUtils.randomAlphabetic(8)))
                    .build())
                .build());
        webAuthnStartAuthenticationAction.execute(context);
        return context.getFlowScope().get("QRCodeTicket", TransientSessionTicket.class);
    }
This is {@link WebAuthnQRCodeControllerMvcTests}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-webauthn/src/test/java/org/apereo/cas/webauthn/web/WebAuthnQRCodeControllerMvcTests.java