Search in sources :

Example 1 with DecoupledEndpointRegistry

use of com.predic8.membrane.core.interceptor.ws_addressing.DecoupledEndpointRegistry in project service-proxy by membrane.

the class WsaEndpointRewriterTest method testRewriteEndpointAddress.

@Test
public void testRewriteEndpointAddress() throws XMLStreamException {
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    WsaEndpointRewriter rewriter = new WsaEndpointRewriter(new DecoupledEndpointRegistry());
    int port = 2000;
    rewriter.rewriteEndpoint(input, output, port, new Exchange(null));
    String rewrittenXml = output.toString();
    System.out.println(rewrittenXml);
    assertTrue(rewrittenXml.contains("<Address>http://localhost:" + port + "/decoupled_endpoint</Address>"));
}
Also used : DecoupledEndpointRegistry(com.predic8.membrane.core.interceptor.ws_addressing.DecoupledEndpointRegistry) Exchange(com.predic8.membrane.core.exchange.Exchange) ByteArrayOutputStream(org.apache.commons.io.output.ByteArrayOutputStream) WsaEndpointRewriter(com.predic8.membrane.core.interceptor.ws_addressing.WsaEndpointRewriter) Test(org.junit.Test)

Aggregations

Exchange (com.predic8.membrane.core.exchange.Exchange)1 DecoupledEndpointRegistry (com.predic8.membrane.core.interceptor.ws_addressing.DecoupledEndpointRegistry)1 WsaEndpointRewriter (com.predic8.membrane.core.interceptor.ws_addressing.WsaEndpointRewriter)1 ByteArrayOutputStream (org.apache.commons.io.output.ByteArrayOutputStream)1 Test (org.junit.Test)1