private Response buildResponse(final MockHttpServletRequest request,
                                   final MockHttpServletResponse response,
                                   final SamlRegisteredService registeredService,
                                   final SamlRegisteredServiceMetadataAdaptor adaptor,
                                   final AuthnRequest authnRequest,
                                   final AuthenticatedAssertionContext assertion,
                                   final String binding) throws Exception {
        val buildContext = SamlProfileBuilderContext.builder()
            .samlRequest(authnRequest)
            .httpRequest(request)
            .httpResponse(response)
            .authenticatedAssertion(Optional.of(assertion))
            .registeredService(registeredService)
            .adaptor(adaptor)
            .binding(binding)
            .build();
        return samlProfileSamlResponseBuilder.build(buildContext);
    }
This is {@link SamlProfileSaml2ResponseBuilderTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-saml-idp/src/test/java/org/apereo/cas/support/saml/web/idp/profile/builders/response/SamlProfileSaml2ResponseBuilderTests.java