use of com.mulesoft.tools.migration.step.category.PomContribution in project mule-migration-assistant by mulesoft.
the class AbstractMigrationTaskTest method execute.
@Test
public void execute() throws Exception {
NamespaceContribution namespaceContributionMock = mock(NamespaceContribution.class);
ApplicationModelContribution applicationModelContributionMock = mock(ApplicationModelContribution.class);
ProjectStructureContribution projectStructureContributionMock = mock(ProjectStructureContribution.class);
PomContribution pomContributionMock = mock(PomContribution.class);
List<MigrationStep> steps = new ArrayList<>();
steps.add(namespaceContributionMock);
steps.add(applicationModelContributionMock);
steps.add(projectStructureContributionMock);
steps.add(pomContributionMock);
InOrder inOrder = Mockito.inOrder(steps.toArray());
migrationTask.setApplicationModel(applicationModelMock);
((MigrationTaskImpl) migrationTask).setMigrationSteps(new ArrayList<>(steps));
migrationTask.execute(mock(MigrationReport.class));
verify(namespaceContributionMock, times(1)).execute(any(ApplicationModel.class), any(MigrationReport.class));
verify(applicationModelContributionMock, times(2)).getAppliedTo();
verify(projectStructureContributionMock, times(1)).execute(isNull(), any(MigrationReport.class));
verify(pomContributionMock, times(1)).execute(any(PomModel.class), any(MigrationReport.class));
inOrder.verify(namespaceContributionMock).execute(any(ApplicationModel.class), any(MigrationReport.class));
inOrder.verify(projectStructureContributionMock).execute(isNull(), any(MigrationReport.class));
inOrder.verify(pomContributionMock).execute(any(PomModel.class), any(MigrationReport.class));
}
Aggregations