Search in sources :

Example 1 with ResourceLocation

use of uk.gov.ida.hub.policy.domain.ResourceLocation in project verify-hub by alphagov.

the class ConfigStubRule method setUpStubForAssertionConsumerServiceUri.

public void setUpStubForAssertionConsumerServiceUri(String entityId, Optional<Integer> assertionConsumerServiceIndex) throws JsonProcessingException {
    UriBuilder uriBuilder = UriBuilder.fromPath(Urls.ConfigUrls.TRANSACTIONS_ASSERTION_CONSUMER_SERVICE_URI_RESOURCE);
    if (assertionConsumerServiceIndex.isPresent()) {
        uriBuilder.queryParam(Urls.ConfigUrls.ASSERTION_CONSUMER_SERVICE_INDEX_PARAM, assertionConsumerServiceIndex.get().toString());
    }
    URI uri = uriBuilder.buildFromEncoded(StringEncoding.urlEncode(entityId).replace("+", "%20"));
    register(uri.toString(), OK, new ResourceLocation(URI.create("thisIsAnRpPostEndpointUri")));
}
Also used : ResourceLocation(uk.gov.ida.hub.policy.domain.ResourceLocation) UriBuilder(javax.ws.rs.core.UriBuilder) URI(java.net.URI)

Aggregations

URI (java.net.URI)1 UriBuilder (javax.ws.rs.core.UriBuilder)1 ResourceLocation (uk.gov.ida.hub.policy.domain.ResourceLocation)1