@Test
    void verifyFails() throws Throwable {
        val context = MockRequestContext.create(applicationContext);
        context.setPreferredLocales(Locale.GERMAN);
        
        WebUtils.putAuthentication(RegisteredServiceTestUtils.getAuthentication("casuser"), context);
        WebUtils.putServiceIntoFlowScope(context, RegisteredServiceTestUtils.getService());

        try (val webServer = new MockWebServer(PORT, StringUtils.EMPTY, HttpStatus.BAD_REQUEST)) {
            webServer.start();
            assertFalse(acceptableUsagePolicyRepository.fetchPolicy(context).isPresent());
            assertFalse(acceptableUsagePolicyRepository.submit(context));
        }
    }
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