use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project mule-migration-assistant by mulesoft.
the class SessionVariablesTest method execute.
@Test
public void execute() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(configPath.toString()).toURI().getPath());
getElementsFromDocument(doc, setSessionVar.getAppliedTo().getExpression()).forEach(node -> setSessionVar.execute(node, report.getReport()));
getElementsFromDocument(doc, removeSessionVars.getAppliedTo().getExpression()).forEach(node -> removeSessionVars.execute(node, report.getReport()));
getElementsFromDocument(doc, mpt.getAppliedTo().getExpression()).forEach(node -> mpt.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 SetPropertyTest method execute.
@Test
public void execute() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(FILE_SAMPLE_PATH.toString()).toURI().getPath());
node = getElementsFromDocument(doc, setProperty.getAppliedTo().getExpression()).get(0);
setProperty.execute(node, report.getReport());
assertThat("The node namespace didn't change", node.getNamespaceURI(), is("http://www.mulesoft.org/schema/mule/compatibility"));
assertThat("The node namespace prefix didn't change", node.getNamespacePrefix(), is("compatibility"));
assertThat("The node name changed", node.getName(), is("set-property"));
assertThat("The attribute was renamed", node.getAttribute("propertyName"), is(notNullValue()));
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project mule-migration-assistant by mulesoft.
the class TrackingTest method execute.
@Test
public void execute() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(configPath.toString()).toURI().getPath());
getElementsFromDocument(doc, tracking.getAppliedTo().getExpression()).forEach(node -> tracking.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 ForEachScopeTest method executeWithJsonTransFormer.
@Test
public void executeWithJsonTransFormer() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(FILE_SAMPLE_PATH.toString()).toURI().getPath());
node = getElementsFromDocument(doc, forEachScope.getAppliedTo().getExpression()).get(0);
forEachScope.execute(node, report.getReport());
Element parent = node.getParentElement();
assertThat("The node didn't change", parent.getChildren(REMOVE_JSON_TRANSFORMER_NAME), is(empty()));
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project mule-migration-assistant by mulesoft.
the class InvocationPropertiesTest method execute.
@Test
public void execute() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(configPath.toString()).toURI().getPath());
getElementsFromDocument(doc, mpt.getAppliedTo().getExpression()).forEach(node -> mpt.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());
}
Aggregations