use of com.mulesoft.tools.migration.project.model.ApplicationModel 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());
}
use of com.mulesoft.tools.migration.project.model.ApplicationModel in project mule-migration-assistant by mulesoft.
the class TrackingTest method setUp.
@Before
public void setUp() throws Exception {
tracking = new Tracking();
ApplicationModel appModel = mock(ApplicationModel.class);
tracking.setExpressionMigrator(new MelToDwExpressionMigrator(report.getReport(), appModel));
tracking.setApplicationModel(appModel);
}
use of com.mulesoft.tools.migration.project.model.ApplicationModel in project mule-migration-assistant by mulesoft.
the class PropertyPlaceholderTest method setUp.
@Before
public void setUp() throws Exception {
ApplicationModel appModel = mock(ApplicationModel.class);
propertyPlaceholder = new PropertyPlaceholder();
propertyPlaceholder.setApplicationModel(appModel);
}
Aggregations