protected void setAuthenticationInContext(final String id) {
        val authentication = CoreAuthenticationTestUtils.getAuthentication(id);
        WebUtils.putAuthentication(authentication, requestContext);
        WebUtils.putAuthenticationResult(new DefaultAuthenticationResult(authentication, null), requestContext);
        val resultBuilder = new DefaultAuthenticationResultBuilder(new DefaultPrincipalElectionStrategy());
        resultBuilder.collect(authentication);
        WebUtils.putAuthenticationResultBuilder(resultBuilder, requestContext);
    }
This is the base class for action tests.

@author Jerome LELEU
@since 6.4.0
support/cas-server-support-inwebo-mfa/src/test/java/org/apereo/cas/support/inwebo/web/flow/actions/BaseInweboActionTests.java