use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project mule-migration-assistant by mulesoft.
the class MetadataTest method execute.
@Test
public void execute() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(configPath.toString()).toURI().getPath());
getElementsFromDocument(doc, setPayload.getAppliedTo().getExpression()).forEach(node -> setPayload.execute(node, report.getReport()));
getElementsFromDocument(doc, dwTransform.getAppliedTo().getExpression()).forEach(node -> dwTransform.execute(node, report.getReport()));
getElementsFromDocument(doc, metadata.getAppliedTo().getExpression()).forEach(node -> metadata.execute(node, report.getReport()));
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
String xmlString = outputter.outputString(doc);
assertThat(xmlString, isSimilarTo(IOUtils.toString(this.getClass().getClassLoader().getResource(targetPath.toString()).toURI(), UTF_8)).ignoreComments().normalizeWhitespace());
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project mule-migration-assistant by mulesoft.
the class PollTest method execute.
@Test
public void execute() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(configPath.toString()).toURI().getPath());
getElementsFromDocument(doc, poll.getAppliedTo().getExpression()).forEach(node -> poll.execute(node, report.getReport()));
getElementsFromDocument(doc, removeSyntheticMigrationAttributes.getAppliedTo().getExpression()).forEach(node -> removeSyntheticMigrationAttributes.execute(node, report.getReport()));
getElementsFromDocument(doc, keepElementsAtBottomOfFlow.getAppliedTo().getExpression()).forEach(node -> keepElementsAtBottomOfFlow.execute(node, report.getReport()));
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
String xmlString = outputter.outputString(doc);
assertThat(xmlString, isSimilarTo(IOUtils.toString(this.getClass().getClassLoader().getResource(targetPath.toString()).toURI(), UTF_8)).ignoreComments().normalizeWhitespace());
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project mule-migration-assistant by mulesoft.
the class PreprocessNamespacesTest method execute.
@Test
public void execute() throws Exception {
preprocessNamespaces.execute(applicationModel, report.getReport());
Document document = Iterables.get(applicationModel.getApplicationDocuments().values(), 0);
assertThat("The namespace was removed.", document.getRootElement().getAdditionalNamespaces().size(), is(3));
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project mule-migration-assistant by mulesoft.
the class ProcessorChainReferenceTest method execute.
@Test
public void execute() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(configPath.toString()).toURI().getPath());
getElementsFromDocument(doc, processorChain.getAppliedTo().getExpression()).forEach(node -> processorChain.execute(node, report.getReport()));
getElementsFromDocument(doc, processorChainReference.getAppliedTo().getExpression()).forEach(node -> processorChainReference.execute(node, report.getReport()));
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
String xmlString = outputter.outputString(doc);
assertThat(xmlString, isSimilarTo(IOUtils.toString(this.getClass().getClassLoader().getResource(targetPath.toString()).toURI(), UTF_8)).ignoreComments().normalizeWhitespace());
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project mule-migration-assistant by mulesoft.
the class ApplicationModel method getNodes.
/**
* Returns all the nodes in the application documents that match the xpath expression
*
* @param xpathExpression the xpath expression that defines which nodes should be retrieved
* @return all the nodes that match the xpath expression
*/
public List<Element> getNodes(XPathExpression xpathExpression) {
checkArgument(xpathExpression != null, "The Xpath Expression must not be null nor empty");
List<Element> nodes = new LinkedList<>();
for (Document doc : getApplicationDocuments().values()) {
nodes.addAll(getElementsFromDocument(xpathExpression, doc));
}
for (Document doc : getDomainDocuments().values()) {
nodes.addAll(getElementsFromDocument(xpathExpression, doc));
}
return nodes;
}
Aggregations