use of java.net.URI in project camel by apache.
the class HttpHelperTest method createURIShouldEncodeExchangeHttpQuery.
@Test
public void createURIShouldEncodeExchangeHttpQuery() throws URISyntaxException {
URI uri = HttpHelper.createURI(createExchangeWithOptionalHttpQueryAndHttpMethodHeader("q= ", null), "http://apache.org/?q=%E2%82%AC", createHttpEndpoint(false, "http://apache.org"));
assertEquals("http://apache.org/?q=%20", uri.toString());
}
use of java.net.URI in project camel by apache.
the class HttpHelperTest method createHttpEndpoint.
private HttpEndpoint createHttpEndpoint(boolean bridgeEndpoint, String endpointURI) throws URISyntaxException {
HttpEndpoint endpoint = new HttpEndpoint();
endpoint.setBridgeEndpoint(bridgeEndpoint);
if (endpointURI != null) {
endpoint.setHttpUri(new URI(endpointURI));
}
return endpoint;
}
use of java.net.URI in project camel by apache.
the class HttpHelperTest method createURIShouldKeepQueryParametersGivenInEndPointUri.
@Test
public void createURIShouldKeepQueryParametersGivenInEndPointUri() throws URISyntaxException {
URI uri = HttpHelper.createURI(createExchangeWithOptionalHttpQueryAndHttpMethodHeader(null, null), "http://apache.org/", createHttpEndpoint(false, "http://apache.org/?q=%E2%82%AC"));
assertEquals("http://apache.org/?q=%E2%82%AC", uri.toString());
}
use of java.net.URI in project camel by apache.
the class HttpMethodsHelperTest method createHttpEndpoint.
private HttpEndpoint createHttpEndpoint(boolean bridgeEndpoint, String endpointURI) throws URISyntaxException {
HttpEndpoint endpoint = new HttpEndpoint();
endpoint.setBridgeEndpoint(bridgeEndpoint);
if (endpointURI != null) {
endpoint.setHttpUri(new URI(endpointURI));
}
return endpoint;
}
use of java.net.URI in project camel by apache.
the class HttpHelperTest method createHttpEndpoint.
private HttpEndpoint createHttpEndpoint(boolean bridgeEndpoint, String endpointURI) throws URISyntaxException {
HttpEndpoint endpoint = new HttpEndpoint();
endpoint.setBridgeEndpoint(bridgeEndpoint);
if (endpointURI != null) {
endpoint.setHttpUri(new URI(endpointURI));
}
return endpoint;
}
Aggregations