use of com.mulesoft.tools.migration.library.apikit.steps.AbstractApikitMigrationStep 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.mulesoft.tools.migration.library.apikit.steps.AbstractApikitMigrationStep in project mule-migration-assistant by mulesoft.
the class ApikitMigrationTest method setUp.
@Before
public void setUp() {
final ApplicationModel applicationModel = getApplicationModel();
final ApikitMigrationTask apikitMigrationTask = new ApikitMigrationTask();
steps = apikitMigrationTask.getSteps().stream().filter(step -> step instanceof AbstractApikitMigrationStep).collect(toList());
steps.forEach(step -> ((AbstractApikitMigrationStep) step).setApplicationModel(applicationModel));
}
Aggregations