@Test
    void verifyValidationFailsBadAccess() throws Throwable {
        val service = CoreAuthenticationTestUtils.getWebApplicationService(UUID.randomUUID().toString());
        val registeredService = RegisteredServiceTestUtils.getRegisteredService(service.getId());
        registeredService.setAccessStrategy(new DefaultRegisteredServiceAccessStrategy(true, true));
        registeredService.setMatchingStrategy(new PartialRegexRegisteredServiceMatchingStrategy());
        registeredService.setProxyPolicy(new RefuseRegisteredServiceProxyPolicy());
        getServicesManager().save(registeredService);
        val ctx = CoreAuthenticationTestUtils.getAuthenticationResult(getAuthenticationSystemSupport(), service);
        val tId = getCentralAuthenticationService().createTicketGrantingTicket(ctx);
        val sId = getCentralAuthenticationService().grantServiceTicket(tId.getId(), service, ctx);

        val request = new MockHttpServletRequest();
        request.addParameter(CasProtocolConstants.PARAMETER_PROXY_GRANTING_TICKET_URL, SERVICE.getId());
        request.addParameter(CasProtocolConstants.PARAMETER_SERVICE, SERVICE.getId());
        request.addParameter(CasProtocolConstants.PARAMETER_TICKET, sId.getId());
        registeredService.setAccessStrategy(new DefaultRegisteredServiceAccessStrategy(false, false));
        val modelAndView = serviceValidateController.handleRequestInternal(request, new MockHttpServletResponse());
        assertNotNull(modelAndView);
        assertNotNull(modelAndView.getView());
        assertTrue(modelAndView.getView().toString().contains("Failure"));
    }
Unit tests for {@link Cas20ResponseView}.

@author Misagh Moayyed
@since 4.0.0
support/cas-server-support-validation/src/test/java/org/apereo/cas/web/view/Cas20ResponseViewTests.java