Package org.apache.camel.component.http4

Examples of org.apache.camel.component.http4.BasicAuthenticationHttpClientConfigurer


        producer.stop();
    }

    @Test
    public void withMethodGetInHeader() throws Exception {
        localServer.register("/", new BasicValidationHandler("GET", null, null, getExpectedContent()));

        HttpComponent component = context.getComponent("http4", HttpComponent.class);

        HttpEndpoint endpoiont = (HttpEndpoint) component.createEndpoint("http4://" + getHostName() + ":" + getPort());
        HttpProducer producer = new HttpProducer(endpoiont);
View Full Code Here


        producer.stop();
    }

    @Test
    public void withEndpointQuery() throws Exception {
        localServer.register("/", new BasicValidationHandler("GET", "q=Camel", null, getExpectedContent()));

        HttpComponent component = context.getComponent("http4", HttpComponent.class);

        HttpEndpoint endpoiont = (HttpEndpoint) component.createEndpoint("http4://" + getHostName() + ":" + getPort() + "?q=Camel");
        HttpProducer producer = new HttpProducer(endpoiont);
View Full Code Here

        producer.stop();
    }

    @Test
    public void withQueryInHeader() throws Exception {
        localServer.register("/", new BasicValidationHandler("GET", "q=Camel", null, getExpectedContent()));

        HttpComponent component = context.getComponent("http4", HttpComponent.class);

        HttpEndpoint endpoiont = (HttpEndpoint) component.createEndpoint("http4://" + getHostName() + ":" + getPort());
        HttpProducer producer = new HttpProducer(endpoiont);
View Full Code Here

        producer.stop();
    }

    @Test
    public void withQueryInHeaderOverrideEndpoint() throws Exception {
        localServer.register("/", new BasicValidationHandler("GET", "q=Camel", null, getExpectedContent()));

        HttpComponent component = context.getComponent("http4", HttpComponent.class);

        HttpEndpoint endpoiont = (HttpEndpoint) component.createEndpoint("http4://" + getHostName() + ":" + getPort() + "?q=Donkey");
        HttpProducer producer = new HttpProducer(endpoiont);
View Full Code Here

        assertExchange(exchange);
    }

    @Override
    protected void registerHandler(LocalTestServer server) {
        server.register("/", new BasicValidationHandler("GET", null, null, getExpectedContent()));
    }
View Full Code Here

        assertExchange(exchange);
    }

    @Override
    protected void registerHandler(LocalTestServer server) {
        server.register("/", new BasicValidationHandler("POST", null, getBody(), getExpectedContent()));
    }
View Full Code Here

*/
public class HttpMethodsTest extends BaseHttpTest {

    @Test
    public void httpGet() throws Exception {
        localServer.register("/", new BasicValidationHandler("GET", null, null, getExpectedContent()));

        Exchange exchange = template.request("http4://" + getHostName() + ":" + getPort() + "/", new Processor() {
            public void process(Exchange exchange) throws Exception {
            }
        });
View Full Code Here

        assertExchange(exchange);
    }

    @Test
    public void httpPost() throws Exception {
        localServer.register("/", new BasicValidationHandler("POST", null, null, getExpectedContent()));

        Exchange exchange = template.request("http4://" + getHostName() + ":" + getPort() + "/", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(Exchange.HTTP_METHOD, "POST");
            }
View Full Code Here

        assertExchange(exchange);
    }

    @Test
    public void httpPostWithBody() throws Exception {
        localServer.register("/", new BasicValidationHandler("POST", null, "rocks camel?", getExpectedContent()));

        Exchange exchange = template.request("http4://" + getHostName() + ":" + getPort() + "/", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setBody("rocks camel?");
            }
View Full Code Here

        assertExchange(exchange);
    }

    @Test
    public void httpPut() throws Exception {
        localServer.register("/", new BasicValidationHandler("PUT", null, null, getExpectedContent()));

        Exchange exchange = template.request("http4://" + getHostName() + ":" + getPort() + "/", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(Exchange.HTTP_METHOD, "PUT");
            }
View Full Code Here

TOP

Related Classes of org.apache.camel.component.http4.BasicAuthenticationHttpClientConfigurer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.