use of com.mulesoft.tools.migration.project.model.pom.PomModel in project mule-migration-assistant by mulesoft.
the class UpdateProjectParentTest method executeWithProjectParentGavAndWithoutParent.
@Test
public void executeWithProjectParentGavAndWithoutParent() throws URISyntaxException, IOException, XmlPullParserException {
UpdateProjectParent updateProjectParent = new UpdateProjectParent();
final ApplicationModel applicationModelMock = mock(ApplicationModel.class);
Parent parent = new Parent.ParentBuilder().withGroupId("com.mule").withArtifactId("rest-parent").withVersion("2.0.0").build();
when(applicationModelMock.getProjectPomParent()).thenReturn(Optional.of(parent));
updateProjectParent.setApplicationModel(applicationModelMock);
Path pomPath = Paths.get(getClass().getResource(POM).toURI());
PomModel model = new PomModel.PomModelBuilder().withPom(pomPath).build();
try {
updateProjectParent.execute(model, report.getReport());
assertTrue(!model.getParent().isPresent());
} catch (RuntimeException e) {
fail("no exception have to be thrown");
}
}
use of com.mulesoft.tools.migration.project.model.pom.PomModel in project mule-migration-assistant by mulesoft.
the class FixedTimeAlgorithmMigrationStepTestCase method rateLimitPomContributionTest.
@Test
public void rateLimitPomContributionTest() throws Exception {
FixedTimeFrameAlgorithmMigrationStep step = new FixedTimeFrameAlgorithmMigrationStep();
step.setApplicationModel(appModel);
Element element = createPolicy(1, FIXED_TIME_FRAME_ALGORITHM_TAG_NAME, false);
step.execute(element, reportMock);
PomModel pm = appModel.getPomModel().get();
assertThat(pm.getDependencies().size(), is(2));
Dependency policyTransformExtensionDependency = pm.getDependencies().get(1);
assertThat(policyTransformExtensionDependency.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
assertThat(policyTransformExtensionDependency.getArtifactId(), is(MULE_THROTTLING_EXTENSION_ARTIFACT_ID));
assertThat(policyTransformExtensionDependency.getVersion(), is(notNullValue()));
assertThat(policyTransformExtensionDependency.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
}
use of com.mulesoft.tools.migration.project.model.pom.PomModel in project mule-migration-assistant by mulesoft.
the class RamlValidatorPomContributionMigrationStepTestCase method pomContributionTestWithPreviousDependency.
@Test
public void pomContributionTestWithPreviousDependency() {
PomModel pm = new PomModel();
pm.addDependency(getRamlDependency());
RamlValidatorPomContributionMigrationStep step = new RamlValidatorPomContributionMigrationStep();
step.execute(pm, mock(MigrationReport.class));
assertThat(pm.getDependencies().size(), is(1));
Dependency httpPolicyTransformExtension = pm.getDependencies().get(0);
assertThat(httpPolicyTransformExtension.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
assertThat(httpPolicyTransformExtension.getArtifactId(), is(MULE_REST_VALIDATOR_EXTENSION));
assertThat(httpPolicyTransformExtension.getVersion(), is(notNullValue()));
assertThat(httpPolicyTransformExtension.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
}
use of com.mulesoft.tools.migration.project.model.pom.PomModel in project mule-migration-assistant by mulesoft.
the class HttpMigrationTaskTestCase method assertPomModel.
private void assertPomModel() {
PomModel pomModel = appModel.getPomModel().get();
assertThat(pomModel.getDependencies().size(), is(1));
Dependency httpPolicyTransform = pomModel.getDependencies().get(0);
assertThat(httpPolicyTransform.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
assertThat(httpPolicyTransform.getArtifactId(), is(MULE_HTTP_POLICY_TRANSFORM_EXTENSION_ARTIFACT_ID));
assertThat(httpPolicyTransform.getVersion(), is(notNullValue()));
assertThat(httpPolicyTransform.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
}
use of com.mulesoft.tools.migration.project.model.pom.PomModel in project mule-migration-assistant by mulesoft.
the class MuleElementsMigrationTaskTestCase method assertPomModel.
private void assertPomModel() {
PomModel pomModel = appModel.getPomModel().get();
assertThat(pomModel.getDependencies().size(), is(1));
Dependency httpPolicyTransformExtension = pomModel.getDependencies().get(0);
assertThat(httpPolicyTransformExtension.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
assertThat(httpPolicyTransformExtension.getArtifactId(), is(MULE_HTTP_POLICY_TRANSFORM_EXTENSION_ARTIFACT_ID));
assertThat(httpPolicyTransformExtension.getVersion(), is(notNullValue()));
assertThat(httpPolicyTransformExtension.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
}
Aggregations