use of com.mulesoft.tools.migration.task.MigrationTask in project mule-migration-assistant by mulesoft.
the class MigrationTaskLocatorTest method locateFromAnyToAny.
@Test
public void locateFromAnyToAny() {
MigrationTaskLocator migrationTaskLocator = new MigrationTaskLocator(ANY_VERSION_3, ANY_VERSION_4);
List<AbstractMigrationTask> migrationTaskList = migrationTaskLocator.locate();
assertThat("The number of migration task is wrong", migrationTaskList.size(), greaterThanOrEqualTo(9));
MigrationTask migrationTask = migrationTaskList.stream().filter(t -> t instanceof MunitMigrationTask).findFirst().get();
assertThat("The migration task from is wrong", isVersionGreaterOrEquals(migrationTask.getFrom(), from), is(true));
assertThat("The migration task to is wrong", isVersionGreaterOrEquals(to, migrationTask.getTo()), is(true));
assertThat("The migration task project type is wrong", migrationTask.getProjectType(), is(projectType));
}
use of com.mulesoft.tools.migration.task.MigrationTask in project mule-migration-assistant by mulesoft.
the class AdditionalNamespacesFactory method getTasksDeclaredNamespaces.
public static List<Namespace> getTasksDeclaredNamespaces(List<AbstractMigrationTask> migrationTasks) {
List<Namespace> taskSupportedNamespaces = new ArrayList<>();
for (MigrationTask task : ofNullable(migrationTasks).orElse(emptyList())) {
MigrationStepSelector stepSelector = new MigrationStepSelector(task.getSteps());
stepSelector.getApplicationModelContributionSteps().forEach(s -> taskSupportedNamespaces.addAll(s.getNamespacesContributions()));
}
taskSupportedNamespaces.add(getNamespace("mule", CORE_NAMESPACE.getURI()));
return taskSupportedNamespaces;
}
use of com.mulesoft.tools.migration.task.MigrationTask in project mule-migration-assistant by mulesoft.
the class MigrationTaskLocatorTest method locate.
@Test
public void locate() {
MigrationTaskLocator migrationTaskLocator = new MigrationTaskLocator(from, to);
List<AbstractMigrationTask> migrationTaskList = migrationTaskLocator.locate();
assertThat("The number of migration task is wrong", migrationTaskList.size(), greaterThan(0));
MigrationTask migrationTask = migrationTaskList.get(0);
assertThat("The migration task type is wrong", migrationTask, instanceOf(PreprocessMuleApplication.class));
assertThat("The migration task from is wrong", isVersionGreaterOrEquals(migrationTask.getFrom(), from), is(true));
assertThat("The migration task to is wrong", isVersionGreaterOrEquals(to, migrationTask.getTo()), is(true));
assertThat("The migration task project type is wrong", migrationTask.getProjectType(), is(projectType));
}
Aggregations