@BeforeEach
        void beforeEach() throws Throwable {
            context = MockRequestContext.create(applicationContext);
            WebUtils.putServiceIntoFlowScope(context, RegisteredServiceTestUtils.getService());
            WebUtils.putRegisteredService(context, RegisteredServiceTestUtils.getRegisteredService("sample-service", Collections.emptyMap()));

            context.withUserAgent();
            val request = context.getHttpServletRequest();
            request.setRemoteAddr("223.456.789.000");
            request.setLocalAddr("123.456.789.000");
            ClientInfoHolder.setClientInfo(ClientInfo.from(request));

            val authn = RegisteredServiceTestUtils.getAuthentication("casuser");
            WebUtils.putAuthentication(authn, context);

            ApplicationContextProvider.holdApplicationContext(applicationContext);
        }
This is {@link MultifactorAuthenticationPrepareTrustDeviceViewActionTests}.

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