private MockRequestContext getMockRequestContext() throws Throwable {
        val context = MockRequestContext.create(applicationContext);
        WebUtils.putServiceIntoFlowScope(context, RegisteredServiceTestUtils.getService());
        val registeredService = RegisteredServiceTestUtils.getRegisteredService("sample-service", Collections.emptyMap());
        WebUtils.putRegisteredService(context, registeredService);

        context.setRemoteAddr("123.456.789.000");
        context.setLocalAddr("123.456.789.000");
        context.withUserAgent();
        context.setClientInfo();
        
        val authn = RegisteredServiceTestUtils.getAuthentication("casuser-setdevice");
        WebUtils.putAuthentication(authn, context);
        return context;
    }
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