@Test
    void verifyAction() throws Throwable {
        val context = MockRequestContext.create(applicationContext);
        context.setParameter(ServiceWarningAction.PARAMETER_NAME_IGNORE_WARNING, "true");

        assertThrows(InvalidTicketException.class, () -> action.execute(context));

        val tgt = new MockTicketGrantingTicket("casuser");
        WebUtils.putTicketGrantingTicketInScopes(context, tgt);
        assertThrows(InvalidTicketException.class, () -> action.execute(context));

        val service = RegisteredServiceTestUtils.getService("https://google.com");
        getServicesManager().save(RegisteredServiceTestUtils.getRegisteredService(service.getId(), Map.of()));
        
        WebUtils.putServiceIntoFlowScope(context, service);
        WebUtils.putCredential(context, CoreAuthenticationTestUtils.getCredentialsWithSameUsernameAndPassword());

        getTicketRegistry().addTicket(tgt);

        assertEquals(CasWebflowConstants.STATE_ID_REDIRECT, action.execute(context).getId());
    }
This is {@link ServiceWarningActionTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-actions/src/test/java/org/apereo/cas/web/flow/ServiceWarningActionTests.java