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();
}
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();
}
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();
}
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();
}
Aggregations