use of com.mulesoft.tools.migration.report.DefaultMigrationReport in project mule-migration-assistant by mulesoft.
the class MigrationJobTest method assertProjectGav.
private void assertProjectGav(Path projectPath, String gav, String expectedGroupId, String expectedArtifactId, String expectedVersion) throws Exception {
migrationJob = new MigrationJob.MigrationJobBuilder().withProject(projectPath).withOutputProject(migratedProjectPath).withInputVersion(MULE_380_VERSION).withOuputVersion(MULE_413_VERSION).withProjectGAV(gav).build();
MunitMigrationTask migrationTask = new MunitMigrationTask();
migrationTasks.add(migrationTask);
Whitebox.setInternalState(migrationJob, "migrationTasks", migrationTasks);
migrationJob.execute(new DefaultMigrationReport());
assertThat(migrationTask.getApplicationModel().getPomModel().get().getGroupId(), is(expectedGroupId));
assertThat(migrationTask.getApplicationModel().getPomModel().get().getArtifactId(), is(expectedArtifactId));
assertThat(migrationTask.getApplicationModel().getPomModel().get().getVersion(), is(expectedVersion));
}
use of com.mulesoft.tools.migration.report.DefaultMigrationReport in project mule-migration-assistant by mulesoft.
the class MigrationJobTest method executeWithTaskThatFailsNotStopExecution.
@Test
public void executeWithTaskThatFailsNotStopExecution() throws Exception {
migrationJob = new MigrationJob.MigrationJobBuilder().withProject(originalProjectPath).withOutputProject(migratedProjectPath).withInputVersion(MULE_380_VERSION).withOuputVersion(MULE_413_VERSION).build();
AbstractMigrationTask migrationTask = mock(AbstractMigrationTask.class);
doThrow(MigrationTaskException.class).when(migrationTask).execute(any(MigrationReport.class));
when(migrationTask.getApplicableProjectTypes()).thenReturn(singleton(MULE_FOUR_APPLICATION));
migrationTasks.add(migrationTask);
Whitebox.setInternalState(migrationJob, "migrationTasks", migrationTasks);
migrationJob.execute(new DefaultMigrationReport());
verify(migrationTask, times(1)).execute(any(MigrationReport.class));
}
use of com.mulesoft.tools.migration.report.DefaultMigrationReport in project mule-migration-assistant by mulesoft.
the class MigrationJobTest method executeCheckApplicationModel.
@Test
public void executeCheckApplicationModel() throws Exception {
migrationJob = new MigrationJob.MigrationJobBuilder().withProject(originalProjectPath).withOutputProject(migratedProjectPath).withInputVersion(MULE_380_VERSION).withOuputVersion(MULE_413_VERSION).build();
MunitMigrationTask migrationTask = new MunitMigrationTask();
migrationTasks.add(migrationTask);
Whitebox.setInternalState(migrationJob, "migrationTasks", migrationTasks);
migrationJob.execute(new DefaultMigrationReport());
assertThat("The application model generated is wrong.", migrationTask.getApplicationModel().getApplicationDocuments().size(), is(2));
}
use of com.mulesoft.tools.migration.report.DefaultMigrationReport in project mule-migration-assistant by mulesoft.
the class MigrationJobTest method execute.
@Test
public void execute() throws Exception {
migrationJob = new MigrationJob.MigrationJobBuilder().withProject(originalProjectPath).withOutputProject(migratedProjectPath).withInputVersion(MULE_380_VERSION).withOuputVersion(MULE_413_VERSION).build();
migrationJob.execute(new DefaultMigrationReport());
}
Aggregations