use of com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyFileRenameMigrationStep in project mule-migration-assistant by mulesoft.
the class BasicStructureMigrationTask method getSteps.
@Override
public List<MigrationStep> getSteps() {
PolicyFileRenameMigrationStep policyFileRenameMigrationStep = new PolicyFileRenameMigrationStep();
policyFileRenameMigrationStep.setApplicationModel(getApplicationModel());
List<MigrationStep> steps = new ArrayList<>();
steps.add(new PolicyTagMigrationStep());
steps.add(new BeforeTagMigrationStep());
steps.add(new AfterTagMigrationStep());
steps.add(new BeforeExceptionTagMigrationStep());
steps.add(new AfterExceptionTagMigrationStep());
steps.add(new PointcutTagMigrationStep());
steps.add(new DataTagMigrationStep());
steps.add(new CleanupAttributesMigrationStep());
steps.add(policyFileRenameMigrationStep);
return steps;
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyFileRenameMigrationStep in project mule-migration-assistant by mulesoft.
the class PolicyFileRenameMigrationStepTestCase method renameTest.
@Test
public void renameTest() throws Exception {
MigrationReport migrationReport = mock(MigrationReport.class);
ApplicationModel.ApplicationModelBuilder amb = new ApplicationModel.ApplicationModelBuilder();
amb.withProjectType(ProjectType.MULE_THREE_POLICY);
amb.withConfigurationFiles(Arrays.asList(APPLICATION_MODEL_PATH.resolve("src/main/mule/simple-test-policy.xml")));
amb.withProjectBasePath(APPLICATION_MODEL_PATH);
appModel = amb.build();
PolicyFileRenameMigrationStep step = new PolicyFileRenameMigrationStep();
step.setApplicationModel(appModel);
step.execute(APPLICATION_MODEL_PATH, migrationReport);
assertThat(APPLICATION_MODEL_PATH.resolve(appModel.getPomModel().get().getArtifactId() + ".yaml").toFile().exists(), is(true));
assertThat(APPLICATION_MODEL_PATH.resolve("simple-test-policy.yaml").toFile().exists(), is(false));
Path sourcesFilePath = APPLICATION_MODEL_PATH.resolve("src/main/mule");
assertThat(sourcesFilePath.resolve("template.xml").toFile().exists(), is(true));
assertThat(sourcesFilePath.resolve("simple-test-policy.xml").toFile().exists(), is(false));
assertThat(appModel.getApplicationDocuments().size(), is(1));
assertThat(appModel.getApplicationDocuments().get(Paths.get("src/main/mule/template.xml")), notNullValue());
assertThat(appModel.getApplicationDocuments().get(Paths.get("src/main/mule/simple-test-policy.xml")), nullValue());
}
Aggregations