@Test
    void verifyServiceByClassReq() {
        val request = new MockHttpServletRequest();
        request.addParameter(CasProtocolConstants.PARAMETER_TARGET_SERVICE, "test");
        assertThrows(ClassCastException.class, () -> serviceFactory.createService(request, mock(Service.class).getClass()));
        assertNotNull(serviceFactory.createService(request, WebApplicationService.class));
    }
Test cases for {@link WebApplicationServiceFactory}.

@author Misagh Moayyed
@since 4.2
core/cas-server-core-services/src/test/java/org/apereo/cas/authentication/principal/WebApplicationServiceFactoryTests.java