Examples of HeaderValidationHandler


Examples of org.apache.camel.component.http4.handler.HeaderValidationHandler

    @Test
    public void httpGetWithProxyAndWithoutUser() throws Exception {
        Map<String, String> expectedHeaders = new HashMap<String, String>();
        expectedHeaders.put("Host", getHostName() + ":" + getPort());
        expectedHeaders.put("Proxy-Connection", "Keep-Alive");
        proxy.register("*", new HeaderValidationHandler("GET", null, null, getExpectedContent(), expectedHeaders));

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

Examples of org.apache.camel.component.http4.handler.HeaderValidationHandler

        Map<String, String> expectedHeaders = new HashMap<String, String>();
        expectedHeaders.put("Host", getHostName() + ":" + getPort());
        expectedHeaders.put("Proxy-Connection", "Keep-Alive");

        try {
            proxy.register("*", new HeaderValidationHandler("GET", null, null, getExpectedContent(), expectedHeaders));

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

Examples of org.apache.camel.component.http4.handler.HeaderValidationHandler

        Map<String, String> expectedHeaders = new HashMap<String, String>();
        expectedHeaders.put("Host", getHostName() + ":" + getPort());
        expectedHeaders.put("Proxy-Connection", "Keep-Alive");

        try {
            proxy.register("*", new HeaderValidationHandler("GET", null, null, getExpectedContent(), expectedHeaders));

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

Examples of org.apache.camel.component.http4.handler.HeaderValidationHandler

    protected void registerHandler(LocalTestServer server) {
        Map<String, String> expectedHeaders = new HashMap<String, String>();
        expectedHeaders.put("Content-Type", "text/plain");
        expectedHeaders.put("Content-Encoding", "gzip");

        server.register("/", new HeaderValidationHandler("POST", null, getBody(), getExpectedContent(), expectedHeaders));
    }
View Full Code Here

Examples of org.apache.camel.component.http4.handler.HeaderValidationHandler

    protected void registerHandler(LocalTestServer server) {
        Map<String, String> expectedHeaders = new HashMap<String, String>();
        expectedHeaders.put("TestHeader", "test");
        expectedHeaders.put("Accept-Language", "pl");

        server.register("/", new HeaderValidationHandler("GET", null, null, getExpectedContent(), expectedHeaders));
    }
View Full Code Here

Examples of org.apache.camel.component.http4.handler.HeaderValidationHandler

    @Test
    public void httpPostWithImage() throws Exception {
        Map<String, String> expectedHeaders = new HashMap<String, String>();
        expectedHeaders.put("Content-Type", "image/jpeg");
        localServer.register("/", new HeaderValidationHandler("POST", null, null, getExpectedContent(), expectedHeaders));

        Exchange exchange = template.send("http4://" + getHostName() + ":" + getPort() + "/", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setBody(new File("src/test/data/logo.jpeg"));
                exchange.getIn().setHeader("Content-Type", "image/jpeg");
View Full Code Here

Examples of org.apache.camel.component.http4.handler.HeaderValidationHandler

    @Test
    public void httpGetWithProxyAndWithoutUser() throws Exception {
        Map<String, String> expectedHeaders = new HashMap<String, String>();
        expectedHeaders.put("Host", getHostName() + ":" + getPort());
        expectedHeaders.put("Proxy-Connection", "Keep-Alive");
        proxy.register("*", new HeaderValidationHandler("GET", null, null, getExpectedContent(), expectedHeaders));

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

Examples of org.apache.camel.component.http4.handler.HeaderValidationHandler

        Map<String, String> expectedHeaders = new HashMap<String, String>();
        expectedHeaders.put("Host", getHostName() + ":" + getPort());
        expectedHeaders.put("Proxy-Connection", "Keep-Alive");

        try {
            proxy.register("*", new HeaderValidationHandler("GET", null, null, getExpectedContent(), expectedHeaders));

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

Examples of org.apache.camel.component.http4.handler.HeaderValidationHandler

        Map<String, String> expectedHeaders = new HashMap<String, String>();
        expectedHeaders.put("Host", getHostName() + ":" + getPort());
        expectedHeaders.put("Proxy-Connection", "Keep-Alive");

        try {
            proxy.register("*", new HeaderValidationHandler("GET", null, null, getExpectedContent(), expectedHeaders));

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

Examples of org.apache.camel.component.http4.handler.HeaderValidationHandler

    protected void registerHandler(LocalTestServer server) {
        Map<String, String> expectedHeaders = new HashMap<String, String>();
        expectedHeaders.put("Content-Type", "text/plain");
        expectedHeaders.put("Content-Encoding", "gzip");

        server.register("/", new HeaderValidationHandler("POST", null, getBody(), getExpectedContent(), expectedHeaders));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.