use of com.google.firestore.v1beta1.Document in project mule-migration-assistant by mulesoft.
the class FirstSuccessfulTest method execute.
@Test
public void execute() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(configPath.toString()).toURI().getPath());
getElementsFromDocument(doc, firstSuccessful.getAppliedTo().getExpression()).forEach(node -> firstSuccessful.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.google.firestore.v1beta1.Document in project mule-migration-assistant by mulesoft.
the class RemoveObjectToStringTransformerTest method execute.
@Test
public void execute() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(FILE_SAMPLE_PATH.toString()).toURI().getPath());
node = getElementsFromDocument(doc, removeObjectToStringTransformer.getAppliedTo().getExpression()).get(0);
removeObjectToStringTransformer.execute(node, report.getReport());
assertThat("The node wasn't remove.", node.getParent(), is(nullValue()));
}
use of com.google.firestore.v1beta1.Document in project mule-migration-assistant by mulesoft.
the class RemoveSyntheticMigrationAttributesTest method execute.
@Test
public void execute() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(configPath.toString()).toURI().getPath());
getElementsFromDocument(doc, removeSyntheticMigrationAttributes.getAppliedTo().getExpression()).forEach(node -> removeSyntheticMigrationAttributes.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.google.firestore.v1beta1.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.google.firestore.v1beta1.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()));
}
Aggregations