@Test
    void verifyFetch() throws Throwable {
        val input = AcceptableUsagePolicyTerms.builder()
            .code("example")
            .defaultText("hello world")
            .build();
        val data = MAPPER.writeValueAsString(input);
        try (val webServer = new MockWebServer(PORT, data)) {
            webServer.start();
            val context = MockRequestContext.create(applicationContext);
            WebUtils.putAuthentication(RegisteredServiceTestUtils.getAuthentication("casuser"), context);
            val terms = acceptableUsagePolicyRepository.fetchPolicy(context);
            assertTrue(terms.isPresent());
            assertEquals(terms.get(), input);
        }
    }
This is {@link RestAcceptableUsagePolicyRepositoryTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-aup-rest/src/test/java/org/apereo/cas/aup/RestAcceptableUsagePolicyRepositoryTests.java