Search in sources :

Example 31 with URI

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());
}
Also used : URI(java.net.URI) Test(org.junit.Test)

Example 32 with URI

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;
}
Also used : HttpEndpoint(org.apache.camel.component.http.HttpEndpoint) URI(java.net.URI)

Example 33 with URI

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());
}
Also used : URI(java.net.URI) Test(org.junit.Test)

Example 34 with URI

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;
}
Also used : HttpEndpoint(org.apache.camel.component.http.HttpEndpoint) URI(java.net.URI)

Example 35 with URI

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;
}
Also used : HttpEndpoint(org.apache.camel.component.http4.HttpEndpoint) URI(java.net.URI)

Aggregations

URI (java.net.URI)5680 Test (org.junit.Test)1852 URISyntaxException (java.net.URISyntaxException)1016 IOException (java.io.IOException)749 File (java.io.File)531 HashMap (java.util.HashMap)458 ArrayList (java.util.ArrayList)452 Test (org.testng.annotations.Test)394 Configuration (org.apache.hadoop.conf.Configuration)321 Path (org.apache.hadoop.fs.Path)267 URL (java.net.URL)266 Map (java.util.Map)262 Response (javax.ws.rs.core.Response)218 List (java.util.List)184 InputStream (java.io.InputStream)154 HashSet (java.util.HashSet)136 FileSystem (org.apache.hadoop.fs.FileSystem)135 RequestContext (com.linkedin.r2.message.RequestContext)129 RestRequestBuilder (com.linkedin.r2.message.rest.RestRequestBuilder)128 RestRequest (com.linkedin.r2.message.rest.RestRequest)112