Search in sources :

Example 1 with HeaderValidationHandler

use of org.apache.camel.component.http4.handler.HeaderValidationHandler in project camel by apache.

the class HttpBodyTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    Map<String, String> expectedHeaders = new HashMap<String, String>();
    expectedHeaders.put("Content-Type", "image/jpeg");
    localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor()).setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory()).setExpectationVerifier(getHttpExpectationVerifier()).setSslContext(getSSLContext()).registerHandler("/post", new BasicValidationHandler("POST", null, getBody(), getExpectedContent())).registerHandler("/post1", new HeaderValidationHandler("POST", null, null, getExpectedContent(), expectedHeaders)).create();
    localServer.start();
    super.setUp();
}
Also used : HashMap(java.util.HashMap) HeaderValidationHandler(org.apache.camel.component.http4.handler.HeaderValidationHandler) BasicValidationHandler(org.apache.camel.component.http4.handler.BasicValidationHandler) Before(org.junit.Before)

Example 2 with HeaderValidationHandler

use of org.apache.camel.component.http4.handler.HeaderValidationHandler in project camel by apache.

the class HttpCompressionTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    Map<String, String> expectedHeaders = new HashMap<String, String>();
    expectedHeaders.put("Content-Type", "text/plain");
    expectedHeaders.put("Content-Encoding", "gzip");
    localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor()).setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory()).setExpectationVerifier(getHttpExpectationVerifier()).setSslContext(getSSLContext()).registerHandler("/", new HeaderValidationHandler("POST", null, getBody(), getExpectedContent(), expectedHeaders)).create();
    localServer.start();
    super.setUp();
}
Also used : HashMap(java.util.HashMap) HeaderValidationHandler(org.apache.camel.component.http4.handler.HeaderValidationHandler) Before(org.junit.Before)

Example 3 with HeaderValidationHandler

use of org.apache.camel.component.http4.handler.HeaderValidationHandler in project camel by apache.

the class HttpProxyServerTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    Map<String, String> expectedHeaders = new HashMap<>();
    expectedHeaders.put("Proxy-Connection", "Keep-Alive");
    proxy = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor()).setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory()).setExpectationVerifier(getHttpExpectationVerifier()).setSslContext(getSSLContext()).registerHandler("*", new HeaderValidationHandler("GET", null, null, getExpectedContent(), expectedHeaders)).create();
    proxy.start();
    super.setUp();
}
Also used : HashMap(java.util.HashMap) HeaderValidationHandler(org.apache.camel.component.http4.handler.HeaderValidationHandler) Before(org.junit.Before)

Example 4 with HeaderValidationHandler

use of org.apache.camel.component.http4.handler.HeaderValidationHandler in project camel by apache.

the class HttpProducerWithSystemPropertiesTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    Map<String, String> expectedHeaders = new HashMap<>();
    expectedHeaders.put("User-Agent", "myCoolCamelCaseAgent");
    localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor()).setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory()).setExpectationVerifier(getHttpExpectationVerifier()).setSslContext(getSSLContext()).registerHandler("*", new HeaderValidationHandler("GET", null, null, getExpectedContent(), expectedHeaders)).create();
    localServer.start();
    super.setUp();
}
Also used : HashMap(java.util.HashMap) HeaderValidationHandler(org.apache.camel.component.http4.handler.HeaderValidationHandler) Before(org.junit.Before)

Aggregations

HashMap (java.util.HashMap)4 HeaderValidationHandler (org.apache.camel.component.http4.handler.HeaderValidationHandler)4 Before (org.junit.Before)4 BasicValidationHandler (org.apache.camel.component.http4.handler.BasicValidationHandler)1