use of nl.nn.adapterframework.core.PipeLine in project iaf by ibissource.
the class WsdlTest method basicMixed.
@Test
public void basicMixed() throws XMLStreamException, IOException, ParserConfigurationException, SAXException, ConfigurationException, URISyntaxException, NamingException {
XmlValidator inputValidator = getXmlValidatorInstance("a", "b", "WsdlTest/test.xsd", "urn:webservice1 WsdlTest/test.xsd");
IValidator outputValidator = inputValidator.getResponseValidator();
PipeLine simple = mockPipeLine(inputValidator, outputValidator, "urn:webservice1", "Test1");
WsdlGenerator wsdl = new WsdlGenerator(simple);
wsdl.init();
test(wsdl, "WsdlTest/webservice1.test.wsdl");
}
use of nl.nn.adapterframework.core.PipeLine in project iaf by ibissource.
the class WsdlTest method mockPipeLine.
protected PipeLine mockPipeLine(IValidator inputValidator, IValidator outputValidator, String targetNamespace, String adapterName) {
PipeLine simple = mock(PipeLine.class);
when(simple.getInputValidator()).thenReturn(inputValidator);
when(simple.getOutputValidator()).thenReturn(outputValidator);
Adapter adp = mock(Adapter.class);
when(simple.getAdapter()).thenReturn(adp);
Configuration cfg = mock(Configuration.class);
when(simple.getAdapter().getConfiguration()).thenReturn(cfg);
final Receiver receiverBase = mock(Receiver.class);
WebServiceListener listener = new WebServiceListener();
listener.setServiceNamespaceURI(targetNamespace);
when(receiverBase.getListener()).thenReturn(listener);
when(adp.getReceivers()).thenAnswer(new Answer<Iterable<Receiver>>() {
public Iterable<Receiver> answer(InvocationOnMock invocation) throws Throwable {
return Arrays.asList(receiverBase);
}
});
when(adp.getName()).thenReturn(adapterName);
when(cfg.getClassLoader()).thenReturn(this.getClass().getClassLoader());
when(adp.getConfigurationClassLoader()).thenReturn(this.getClass().getClassLoader());
when(simple.getConfigurationClassLoader()).thenReturn(this.getClass().getClassLoader());
return simple;
}
use of nl.nn.adapterframework.core.PipeLine in project iaf by ibissource.
the class ApiServiceDispatcher method mapRequest.
private void mapRequest(IAdapter adapter, MediaTypes consumes, JsonObjectBuilder methodBuilder) {
PipeLine pipeline = adapter.getPipeLine();
Json2XmlValidator inputValidator = getJsonValidator(pipeline, false);
if (inputValidator != null && StringUtils.isNotEmpty(inputValidator.getRoot())) {
JsonObjectBuilder requestBodyContent = Json.createObjectBuilder();
JsonObjectBuilder schemaBuilder = Json.createObjectBuilder().add("schema", Json.createObjectBuilder().add("$ref", SCHEMA_DEFINITION_PATH + inputValidator.getRoot()));
requestBodyContent.add("content", Json.createObjectBuilder().add(consumes.getContentType(), schemaBuilder));
methodBuilder.add("requestBody", requestBodyContent);
}
}
Aggregations