use of com.predic8.membrane.core.exchange.Exchange in project service-proxy by membrane.
the class ValidatorInterceptorTest method setUp.
@Before
public void setUp() throws Exception {
requestTB = MessageUtil.getPostRequest("http://thomas-bayer.com");
requestXService = MessageUtil.getPostRequest("http://ws.xwebservices.com");
exc = new Exchange(null);
}
use of com.predic8.membrane.core.exchange.Exchange in project service-proxy by membrane.
the class RewriteInterceptorTest method setUp.
@Before
public void setUp() throws Exception {
HttpRouter router = new HttpRouter();
di = new DispatchingInterceptor();
di.init(router);
sp = new ServiceProxy(new ServiceProxyKey(80, null), "www.predic8.de", 80);
sp.init(router);
exc = new Exchange(null);
exc.setRequest(MessageUtil.getGetRequest("/buy/banana/3"));
rewriter = new RewriteInterceptor();
List<Mapping> mappings = new ArrayList<Mapping>();
mappings.add(new Mapping("/buy/(.*)/(.*)", "/buy?item=$1&amount=$2", null));
rewriter.setMappings(mappings);
rewriter.init(router);
}
use of com.predic8.membrane.core.exchange.Exchange in project service-proxy by membrane.
the class SoapOperationExtractorTest method notSoap.
@Test
public void notSoap() throws Exception {
Exchange exc = getExchange("soapOperationExtractor/notSoap.xml");
extractor.handleRequest(exc);
Assert.assertNull(exc.getProperty(SoapOperationExtractor.SOAP_OPERATION));
Assert.assertNull(exc.getProperty(SoapOperationExtractor.SOAP_OPERATION_NS));
}
use of com.predic8.membrane.core.exchange.Exchange in project service-proxy by membrane.
the class SoapOperationExtractorTest method nonEmptyHeader.
@Test
public void nonEmptyHeader() throws Exception {
Exchange exc = getExchange("soapOperationExtractor/getBuecherWithHeader.xml");
extractor.handleRequest(exc);
Assert.assertEquals("getBuecher", exc.getProperty(SoapOperationExtractor.SOAP_OPERATION));
Assert.assertEquals("http://predic8.de", exc.getProperty(SoapOperationExtractor.SOAP_OPERATION_NS));
}
use of com.predic8.membrane.core.exchange.Exchange in project service-proxy by membrane.
the class SoapOperationExtractorTest method getExchange.
private Exchange getExchange(String path) throws IOException {
Exchange exc = new Exchange(null);
Request req = new Request();
req.create("POST", "http://test", "HTTP/", new Header(), getClass().getClassLoader().getResourceAsStream(path));
exc.setRequest(req);
return exc;
}
Aggregations