@Test
    void verifyQRCodeSuccessfully() throws Exception {
        val context = MockRequestContext.create(webApplicationContext);
        val authn = RegisteredServiceTestUtils.getAuthentication(UUID.randomUUID().toString());
        val ticket = getQRCodeTicket(context, authn);
        val csrfToken = createCsrfToken(context);
        val sessionId = webAuthnSessionManager.createSession(ByteArray.fromBase64Url(authn.getPrincipal().getId()));
        val mv = mvc.perform(post(BASE_ENDPOINT)
                .cookie(context.getHttpServletResponse().getCookie("XSRF-TOKEN"))
                .queryParam("token", sessionId.getBase64Url())
                .queryParam("ticket", ticket.getId())
                .queryParam("principal", authn.getPrincipal().getId())
                .header("X-CSRF-TOKEN", csrfToken.getToken())
            )
            .andExpect(status().isOk())
            .andReturn()
            .getModelAndView();
        assertTrue((Boolean) mv.getModel().get("success"));
        assertNotNull(mv.getModel().get("principal"));

        mvc.perform(get(BASE_ENDPOINT + "/{ticket}/status", ticket.getId()))
            .andExpect(status().isOk());
        mvc.perform(get(BASE_ENDPOINT + "/{ticket}/status", UUID.randomUUID().toString()))
            .andExpect(status().isBadRequest());
    }
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