protected MockRequestContext getRequestContext(final String actualPrincipalId,
                                                   final Map<String, List<Object>> profileAttributes,
                                                   final Credential credential) throws Throwable {
        val context = MockRequestContext.create();
        val tgt = new MockTicketGrantingTicket(actualPrincipalId, credential, profileAttributes);
        ticketRegistry.addTicket(tgt);
        val principal = CoreAuthenticationTestUtils.getPrincipal(credential.getId(), profileAttributes);
        WebUtils.putAuthentication(CoreAuthenticationTestUtils.getAuthentication(principal), context);
        WebUtils.putTicketGrantingTicketInScopes(context, tgt);
        return context;
    }
Repository can update the state of the AUP acceptance without reloading the principal. Mostly for testing purposes.

@return live updates are possible.
support/cas-server-support-aup-webflow/src/test/java/org/apereo/cas/aup/BaseAcceptableUsagePolicyRepositoryTests.java