@Test
    void verifyOperation() throws Exception {
        val context = MockRequestContext.create(applicationContext);
        val request = (MockHttpServletRequest) WebUtils.getHttpServletRequestFromExternalWebflowContext(context);
        val response = (MockHttpServletResponse) WebUtils.getHttpServletResponseFromExternalWebflowContext(context);

        webAuthnPopulateCsrfTokenAction.execute(context);
        val csrf1 = context.getFlowScope().get("_csrf", CsrfToken.class);
        assertNotNull(csrf1);
        assertEquals("X-CSRF-TOKEN", csrf1.getHeaderName());

        request.setCookies(response.getCookie("XSRF-TOKEN"));

        webAuthnPopulateCsrfTokenAction.execute(context);
        val csrf2 = context.getFlowScope().get("_csrf", CsrfToken.class);
        assertEquals(csrf1.getToken(), csrf2.getToken());
        assertEquals(csrf1.getParameterName(), csrf2.getParameterName());
        assertEquals(csrf1.getHeaderName(), csrf2.getHeaderName());
    }
This is {@link WebAuthnPopulateCsrfTokenActionTests}.

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