use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project mule-migration-assistant by mulesoft.
the class ApikitMigrationTest method execute.
@Test
public void execute() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(configPath.toString()).toURI().getPath());
steps.forEach(step -> getElementsFromDocument(doc, ((AbstractApikitMigrationStep) step).getAppliedTo().getExpression()).forEach(node -> step.execute(node, mock(MigrationReport.class))));
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 AbstractFederationTestCase method getTestElement.
protected Element getTestElement() {
Element testElement = new Element(VALIDATE_TAG_NAME, getTestElementNamespace()).setAttribute(TOKEN_URL_ATTR_NAME, TOKEN_URL_ATTR_VALUE).setAttribute(THROW_ON_UNACCEPTED_ATTR_NAME, TRUE).setAttribute(ON_UNACCEPTED, ON_UNACCEPTED_ATTR_VALUE);
Element root = new Element(MULE_4_TAG_NAME, MULE_4_CORE_NAMESPACE_NO_PREFIX);
root.addNamespaceDeclaration(MULE_4_POLICY_NAMESPACE);
new Document().setRootElement(root.addContent(getProcessorChainElement()).addContent(testElement));
return testElement;
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project mule-migration-assistant by mulesoft.
the class GatewayMigrationStep method getRootElement.
protected Element getRootElement(final Element element) {
Document doc = element.getDocument();
if (doc != null) {
return doc.getRootElement();
}
Element e = new Element(MULE_4_TAG_NAME, MULE_4_POLICY_NAMESPACE).addContent(element);
e.addNamespaceDeclaration(MULE_4_CORE_NAMESPACE_NO_PREFIX);
new Document().setRootElement(e);
return e;
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project mule-migration-assistant by mulesoft.
the class DefaultMigrationReportTest method notAddDuplicateEntryTest.
@Test
public void notAddDuplicateEntryTest() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(MUNIT_SAMPLE_PATH.toString()).toURI().getPath());
Element node = getElementsFromDocument(doc, assertTrue.getAppliedTo().getExpression()).get(0);
defaultMigrationReport.report(WARN, node, node, "Message", "docLink");
defaultMigrationReport.report(WARN, node, node, "Message2", "newLink");
defaultMigrationReport.report(WARN, node, node, "Message", "docLink");
assertThat("Duplicate entry added.", defaultMigrationReport.getReportEntries().size(), is(2));
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project mule-migration-assistant by mulesoft.
the class HttpRequesterConfigTest method execute.
@Test
public void execute() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(configPath.toString()).toURI().getPath());
getElementsFromDocument(doc, httpRequesterConfig.getAppliedTo().getExpression()).forEach(node -> httpRequesterConfig.execute(node, report.getReport()));
getElementsFromDocument(doc, socketsConfig.getAppliedTo().getExpression()).forEach(node -> socketsConfig.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