@Test
    void verifyDeviceTracked() throws Throwable {
        val context = getMockRequestContext();
        MultifactorAuthenticationTrustUtils.setMultifactorAuthenticationTrustedInScope(context);
        val bean = new MultifactorAuthenticationTrustBean().setDeviceName("ApereoCAS");
        MultifactorAuthenticationTrustUtils.putMultifactorAuthenticationTrustRecord(context, bean);

        assertEquals(CasWebflowConstants.TRANSITION_ID_SUCCESS, mfaSetTrustAction.execute(context).getId());
        val record = mfaTrustEngine.get("casuser-setdevice");
        assertTrue(record.isEmpty());
        val authn = WebUtils.getAuthentication(context);
        assertTrue(authn.containsAttribute(
            casProperties.getAuthn().getMfa().getTrusted().getCore().getAuthenticationContextAttribute()));
    }
This is {@link MultifactorAuthenticationSetTrustActionTests}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-trusted-mfa/src/test/java/org/apereo/cas/trusted/web/flow/MultifactorAuthenticationSetTrustActionTests.java