use of com.mulesoft.tools.migration.project.model.ApplicationModel.ApplicationModelBuilder in project mule-migration-assistant by mulesoft.
the class SecurePropertiesTest method execute.
@Test
public void execute() throws Exception {
Path resolvedConfigPath = Paths.get(this.getClass().getClassLoader().getResource(configPath.toString()).toURI());
ApplicationModel appModel = new ApplicationModelBuilder().withProjectBasePath(Paths.get(this.getClass().getClassLoader().getResource(SECURE_PROPS_EXAMPLES_PATH.toString()).toURI())).withConfigurationFiles(asList(resolvedConfigPath)).withMuleVersion(muleVersion).withProjectType(MULE_FOUR_APPLICATION).build();
Document doc = appModel.getApplicationDocuments().get(configPath.getFileName());
securePropertiesPlaceholder.setApplicationModel(appModel);
getElementsFromDocument(doc, securePropertiesPlaceholder.getAppliedTo().getExpression()).forEach(node -> securePropertiesPlaceholder.execute(node, report.getReport()));
XMLOutputter muleOutputter = new XMLOutputter(Format.getPrettyFormat());
String muleXmlString = muleOutputter.outputString(doc);
assertThat(muleXmlString, isSimilarTo(IOUtils.toString(this.getClass().getClassLoader().getResource(targetMulePath.toString()).toURI(), UTF_8)).ignoreComments().normalizeWhitespace());
}
Aggregations