@Test
    void verifyPayloadAsAttr() {
        val request = new MockHttpServletRequest();
        request.setMethod(HttpMethod.POST.name());
        request.setParameter(SamlProtocolConstants.CONST_PARAM_TARGET, "test");
        request.setAttribute(SamlProtocolConstants.PARAMETER_SAML_REQUEST, BODY);
        request.setRequestURI(SamlProtocolConstants.ENDPOINT_SAML_VALIDATE);
        assertNotNull(samlServiceFactory.createService(request));
        assertThrows(NotImplementedException.class, () -> samlServiceFactory.createService("serviceid"));
    }
Test cases for {@link SamlServiceFactory}

@author Misagh Moayyed
@since 4.2
support/cas-server-support-saml/src/test/java/org/apereo/cas/support/saml/authentication/principal/SamlServiceFactoryTests.java