use of nl.nn.adapterframework.core.PipeLineSession in project iaf by ibissource.
the class SoapWrapperPipeTest method testWrapSoapVersionNone.
@Test
public void testWrapSoapVersionNone() throws Exception {
pipe.setOutputNamespace(TARGET_NAMESPACE);
pipe.setSoapVersion(SoapVersion.NONE);
pipe.configure();
pipe.start();
String input = "<root>\n" + "<attrib>1</attrib>\n" + "<attrib>2</attrib>\n" + "</root>";
String expected = "<root xmlns=\"" + TARGET_NAMESPACE + "\">\n" + "<attrib>1</attrib>\n" + "<attrib>2</attrib>\n" + "</root>";
PipeRunResult prr = doPipe(pipe, input, new PipeLineSession());
String actual = prr.getResult().asString();
TestAssertions.assertEqualsIgnoreCRLF(expected, actual);
}
use of nl.nn.adapterframework.core.PipeLineSession in project iaf by ibissource.
the class SoapWrapperPipeTest method testWrap.
@Test
public void testWrap() throws Exception {
pipe.setOutputNamespace(TARGET_NAMESPACE);
pipe.configure();
pipe.start();
String input = "<root>\n" + "<attrib>1</attrib>\n" + "<attrib>2</attrib>\n" + "</root>";
String expected = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Body>" + "<root xmlns=\"" + TARGET_NAMESPACE + "\">\n" + "<attrib>1</attrib>\n" + "<attrib>2</attrib>\n" + "</root></soapenv:Body></soapenv:Envelope>";
PipeRunResult prr = doPipe(pipe, input, new PipeLineSession());
String actual = prr.getResult().asString();
TestAssertions.assertEqualsIgnoreCRLF(expected, actual);
}
use of nl.nn.adapterframework.core.PipeLineSession in project iaf by ibissource.
the class SoapWrapperPipeTest method testUnwrapRemoveNamespaces.
@Test
public void testUnwrapRemoveNamespaces() throws Exception {
pipe.setDirection(Direction.UNWRAP);
pipe.setRemoveOutputNamespaces(true);
pipe.configure();
pipe.start();
String input = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Body>" + "<root xmlns=\"" + TARGET_NAMESPACE + "\">\n" + "<attrib>1</attrib>\n" + "<attrib>2</attrib>\n" + "</root></soapenv:Body></soapenv:Envelope>";
String expected = "<root>\n" + "<attrib>1</attrib>\n" + "<attrib>2</attrib>\n" + "</root>";
PipeRunResult prr = doPipe(pipe, input, new PipeLineSession());
String actual = prr.getResult().asString();
TestAssertions.assertEqualsIgnoreCRLF(expected, actual);
}
use of nl.nn.adapterframework.core.PipeLineSession in project iaf by ibissource.
the class SoapWrapperPipeTest method testWrapChangeRoot.
@Test
public void testWrapChangeRoot() throws Exception {
pipe.setOutputNamespace(TARGET_NAMESPACE);
pipe.setRoot("OtherRoot");
pipe.configure();
pipe.start();
String input = "<root>\n" + "<attrib>1</attrib>\n" + "<attrib>2</attrib>\n" + "</root>";
String expected = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Body>" + "<OtherRoot xmlns=\"" + TARGET_NAMESPACE + "\">" + "<attrib>1</attrib>" + "<attrib>2</attrib>" + "</OtherRoot></soapenv:Body></soapenv:Envelope>";
PipeRunResult prr = doPipe(pipe, input, new PipeLineSession());
String actual = prr.getResult().asString();
TestAssertions.assertEqualsIgnoreCRLF(expected, actual);
}
use of nl.nn.adapterframework.core.PipeLineSession in project iaf by ibissource.
the class SoapWrapperPipeTest method testUnwrap.
@Test
public void testUnwrap() throws Exception {
pipe.setDirection(Direction.UNWRAP);
pipe.configure();
pipe.start();
String input = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Body>" + "<root xmlns=\"" + TARGET_NAMESPACE + "\">\n" + "<attrib>1</attrib>\n" + "<attrib>2</attrib>\n" + "</root></soapenv:Body></soapenv:Envelope>";
String expected = "<root xmlns=\"" + TARGET_NAMESPACE + "\">\n" + "<attrib>1</attrib>\n" + "<attrib>2</attrib>\n" + "</root>";
PipeRunResult prr = doPipe(pipe, input, new PipeLineSession());
String actual = prr.getResult().asString();
TestAssertions.assertEqualsIgnoreCRLF(expected, actual);
}
Aggregations