class OutboundAuthnResponseFromCountryContainerToSamlResponseTransformer implements Function<AuthnResponseFromCountryContainerDto, Response> {

    @Override
    public Response apply(AuthnResponseFromCountryContainerDto countryResponseDto) {
        Response transformedResponse = openSamlXmlObjectFactory.createResponse();

        transformedResponse.setIssuer(openSamlXmlObjectFactory.createIssuer(hubEntityId));
        transformedResponse.setID(countryResponseDto.getResponseId());
        transformedResponse.setInResponseTo(countryResponseDto.getInResponseTo());
        transformedResponse.setIssueInstant(DateTime.now());
        transformedResponse.setDestination(countryResponseDto.getPostEndpoint().toASCIIString());

        setSuccessStatusCode(transformedResponse);
        setAssertion(transformedResponse, countryResponseDto);

        return transformedResponse;
    }

    public  OutboundAuthnResponseFromCountryContainerToSamlResponseTransformer(
            OpenSamlXmlObjectFactory openSamlXmlObjectFactory,
            String hubEntityId,
            IdGenerator idGenerator
    );

}