use of com.mulesoft.tools.migration.step.AbstractApplicationModelMigrationStep in project mule-migration-assistant by mulesoft.
the class HttpPolicyMigrationTestCase method setUp.
@Before
public void setUp() throws Exception {
ApplicationModel.ApplicationModelBuilder amb = new ApplicationModel.ApplicationModelBuilder();
amb.withProjectType(ProjectType.MULE_THREE_POLICY);
amb.withProjectBasePath(POLICY_APPLICATION_MODEL_PATH);
appModel = amb.build();
doc = getDocument(this.getClass().getClassLoader().getResource(configPath.toString()).toURI().getPath());
HttpMigrationTask task = new HttpMigrationTask();
task.setApplicationModel(appModel);
steps = task.getSteps().stream().filter(step -> step instanceof AbstractApplicationModelMigrationStep).collect(toList());
BasicStructureMigrationTask basicStructureTask = new BasicStructureMigrationTask();
basicStructureTask.setApplicationModel(appModel);
List<MigrationStep> basicStructureSteps = basicStructureTask.getSteps().stream().filter(step -> step instanceof AbstractApplicationModelMigrationStep).collect(toList());
steps.addAll(basicStructureSteps);
}
use of com.mulesoft.tools.migration.step.AbstractApplicationModelMigrationStep in project mule-migration-assistant by mulesoft.
the class HttpPolicyMigrationTestCase method execute.
@Test
public void execute() throws Exception {
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
steps.forEach(step -> migrate((AbstractApplicationModelMigrationStep) step));
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.step.AbstractApplicationModelMigrationStep in project mule-migration-assistant by mulesoft.
the class ClientIdEnforcementPolicyMigrationTestCase method execute.
@Test
public void execute() throws Exception {
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
steps.forEach(step -> migrate((AbstractApplicationModelMigrationStep) step));
String xmlString = outputter.outputString(doc);
assertThat(xmlString, isSimilarTo(IOUtils.toString(this.getClass().getClassLoader().getResource(targetPath.toString()).toURI(), UTF_8)).ignoreComments().normalizeWhitespace());
}
Aggregations