use of com.predic8.membrane.core.exchange.Exchange in project service-proxy by membrane.
the class XMLProtectionInterceptorTest method setUp.
@Before
public void setUp() throws Exception {
exc = new Exchange(null);
exc.setRequest(MessageUtil.getGetRequest("/axis2/services/BLZService"));
exc.setOriginalHostHeader("thomas-bayer.com:80");
interceptor = new XMLProtectionInterceptor();
}
use of com.predic8.membrane.core.exchange.Exchange in project service-proxy by membrane.
the class XSLTInterceptorTest method testXSLTParameter.
@Test
public void testXSLTParameter() throws Exception {
exc = new Exchange(null);
exc.setResponse(Response.ok().body(getClass().getResourceAsStream("/customer.xml"), true).build());
exc.setProperty("XSLT_COMPANY", "predic8");
XSLTInterceptor i = new XSLTInterceptor();
i.setXslt("classpath:/customer2personAddCompany.xsl");
i.init(new HttpRouter());
i.handleResponse(exc);
// printBodyContent();
assertXPath("/person/name/first", "Rick");
assertXPath("/person/name/last", "Cort\u00e9s Ribotta");
assertXPath("/person/address/street", "Calle P\u00fablica \"B\" 5240 Casa 121");
assertXPath("/person/address/city", "Omaha");
assertXPath("/person/company", "predic8");
}
use of com.predic8.membrane.core.exchange.Exchange in project service-proxy by membrane.
the class SOAPFaultTest method testValidateFaults.
@Test
public void testValidateFaults() throws Exception {
ValidatorInterceptor i = createValidatorInterceptor(false);
Exchange exc = createFaultExchange();
assertEquals(Outcome.ABORT, i.handleResponse(exc));
assertContainsNot("secret", exc.getResponse().toString());
}
use of com.predic8.membrane.core.exchange.Exchange in project service-proxy by membrane.
the class SOAPFaultTest method testSkipFaults.
@Test
public void testSkipFaults() throws Exception {
ValidatorInterceptor i = createValidatorInterceptor(true);
Exchange exc = createFaultExchange();
assertEquals(Outcome.CONTINUE, i.handleResponse(exc));
assertContains("secret", exc.getResponse().toString());
}
use of com.predic8.membrane.core.exchange.Exchange in project service-proxy by membrane.
the class SOAPMessageValidatorInterceptorTest 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);
}
Aggregations