@Test
    void verifyAction() throws Throwable {

        val appContext = mock(ApplicationContext.class);
        when(appContext.getMessage(anyString(), any(), anyString(), any(Locale.class))).thenReturn("hello.world");
        val context = MockRequestContext.create(appContext);
        WebUtils.putCredential(context, CoreAuthenticationTestUtils.getCredentialsWithSameUsernameAndPassword());
        WebUtils.putTicketGrantingTicketInScopes(context, new MockTicketGrantingTicket("casuser"));
        WebUtils.putAuthentication(CoreAuthenticationTestUtils.getAuthentication(), context);
        assertNull(acceptableUsagePolicyRenderAction.execute(context));
        val terms = WebUtils.getAcceptableUsagePolicyTermsFromFlowScope(context, AcceptableUsagePolicyTerms.class);
        assertNotNull(terms);
        assertTrue(terms.getCode().startsWith(AcceptableUsagePolicyTerms.CODE));
    }
This is {@link AcceptableUsagePolicyRenderActionTests}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-aup-webflow/src/test/java/org/apereo/cas/web/flow/AcceptableUsagePolicyRenderActionTests.java