@Test
    void verifyAdaptiveError() throws Throwable {
        val context = MockRequestContext.create(applicationContext);
        
        context.getHttpServletRequest().setRemoteUser("xyz");
        context.setRemoteAddr("1.2.3.4");
        context.setLocalAddr("1.2.3.4");
        context.withUserAgent();
        context.setParameter("geolocation", "1000,1000,1000,1000");
        context.setClientInfo();

        context.setParameter(casProperties.getAuthn().getMfa().getTriggers().getHttp().getRequestParameter(), "mfa-whatever");
        WebUtils.putServiceIntoFlowScope(context, RegisteredServiceTestUtils.getService());
        assertEquals(CasWebflowConstants.TRANSITION_ID_AUTHENTICATION_FAILURE, this.action.execute(context).getId());
    }
This is {@link PrincipalFromRequestHeaderNonInteractiveCredentialsActionTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-trusted/src/test/java/org/apereo/cas/adaptors/trusted/web/flow/PrincipalFromRequestHeaderNonInteractiveCredentialsActionTests.java