public static AuthnRequest getAuthnRequest(final OpenSamlConfigBean openSamlConfigBean,
                                               final SamlRegisteredService samlRegisteredService) {
        var builder = (SAMLObjectBuilder) openSamlConfigBean.getBuilderFactory()
            .getBuilder(AuthnRequest.DEFAULT_ELEMENT_NAME);
        var authnRequest = (AuthnRequest) Objects.requireNonNull(builder).buildObject();
        authnRequest.setID("abcdefg1234567890");
        builder = (SAMLObjectBuilder) openSamlConfigBean.getBuilderFactory()
            .getBuilder(Issuer.DEFAULT_ELEMENT_NAME);
        val issuer = (Issuer) Objects.requireNonNull(builder).buildObject();
        issuer.setValue(samlRegisteredService.getServiceId());
        authnRequest.setIssuer(issuer);
        return authnRequest;
    }
Gets authn request.

@param openSamlConfigBean    the open saml config bean
@param samlRegisteredService the saml registered service
@return the authn request
support/cas-server-support-saml-idp/src/test/java/org/apereo/cas/support/saml/SamlIdPTestUtils.java