use of com.mulesoft.tools.migration.project.model.pom.Dependency in project mule-migration-assistant by mulesoft.
the class FederationMigrationTaskTestCase method assertPomModel.
private void assertPomModel() {
PomModel pomModel = appModel.getPomModel().get();
assertThat(pomModel.getDependencies().size(), is(2));
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));
Dependency federationExtensionDependency = pomModel.getDependencies().get(1);
assertThat(federationExtensionDependency.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
assertThat(federationExtensionDependency.getArtifactId(), is(MULE_FEDERATION_EXTENSION_ARTIFACT_ID));
assertThat(federationExtensionDependency.getVersion(), is(notNullValue()));
assertThat(federationExtensionDependency.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
}
use of com.mulesoft.tools.migration.project.model.pom.Dependency in project mule-migration-assistant by mulesoft.
the class ProxyResponseHeadersProcessorMigrationStepTestCase method customProcessorPomContributionTest.
@Test
public void customProcessorPomContributionTest() throws Exception {
final ProxyResponseHeadersProcessorMigrationStep step = new ProxyResponseHeadersProcessorMigrationStep();
step.setApplicationModel(appModel);
step.execute(appModel.getNode(XPATH_NODE_EXPRESSION), reportMock);
PomModel pm = appModel.getPomModel().get();
assertThat(pm.getDependencies().size(), is(1));
Dependency customProcessorDependency = pm.getDependencies().get(0);
assertThat(customProcessorDependency.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
assertThat(customProcessorDependency.getArtifactId(), is(MULE_HTTP_PROXY_EXTENSION_ARTIFACT_ID));
assertThat(customProcessorDependency.getVersion(), is(notNullValue()));
assertThat(customProcessorDependency.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
}
use of com.mulesoft.tools.migration.project.model.pom.Dependency in project mule-migration-assistant by mulesoft.
the class SetPropertyMigrationStepTestCase method pomContributionsInSetPropertyTest.
@Test
public void pomContributionsInSetPropertyTest() {
SetPropertyMigrationStep step = new SetPropertyMigrationStep();
step.setApplicationModel(appModel);
Element element = appModel.getNodes(XPATH_NODE_EXPRESSION).get(0);
step.execute(element, reportMock);
PomModel pm = appModel.getPomModel().get();
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_HTTP_POLICY_TRANSFORM_EXTENSION_ARTIFACT_ID));
assertThat(httpPolicyTransformExtension.getVersion(), is(notNullValue()));
assertThat(httpPolicyTransformExtension.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
}
use of com.mulesoft.tools.migration.project.model.pom.Dependency in project mule-migration-assistant by mulesoft.
the class SpringPomContribution method execute.
@Override
public void execute(PomModel object, MigrationReport report) throws RuntimeException {
object.addDependency(new DependencyBuilder().withGroupId("org.mule.modules").withArtifactId("mule-spring-module").withVersion(targetVersion("mule-spring-module")).withClassifier("mule-plugin").build());
Dependency springCore = new DependencyBuilder().withGroupId("org.springframework").withArtifactId("spring-core").withVersion(SPRING_VERSION).build();
object.addDependency(springCore);
Dependency springBeans = new DependencyBuilder().withGroupId("org.springframework").withArtifactId("spring-beans").withVersion(SPRING_VERSION).build();
object.addDependency(springBeans);
Dependency springContext = new DependencyBuilder().withGroupId("org.springframework").withArtifactId("spring-context").withVersion(SPRING_VERSION).build();
object.addDependency(springContext);
Dependency springAop = new DependencyBuilder().withGroupId("org.springframework").withArtifactId("spring-aop").withVersion(SPRING_VERSION).build();
object.addDependency(springAop);
Dependency springSecurityCore = new DependencyBuilder().withGroupId("org.springframework.security").withArtifactId("spring-security-core").withVersion(SPRING_SECURITY_VERSION).build();
object.addDependency(springSecurityCore);
Dependency springSecurityConfig = new DependencyBuilder().withGroupId("org.springframework.security").withArtifactId("spring-security-config").withVersion(SPRING_SECURITY_VERSION).build();
object.addDependency(springSecurityConfig);
addSharedLibs(object, springCore, springBeans, springContext, springAop, springSecurityCore, springSecurityConfig);
}
use of com.mulesoft.tools.migration.project.model.pom.Dependency in project mule-migration-assistant by mulesoft.
the class ThreatProtectionMigrationTaskTestCase method assertPomModel.
private void assertPomModel(boolean isXmlThreatProtection) {
PomModel pomModel = appModel.getPomModel().get();
Dependency threatProtectionDependency;
if (isXmlThreatProtection) {
assertThat(pomModel.getDependencies().size(), is(3));
threatProtectionDependency = pomModel.getDependencies().get(2);
assertThat(threatProtectionDependency.getArtifactId(), is(MULE_XML_THREAT_PROTECTION_EXTENSION_ARTIFACT_ID));
} else {
assertThat(pomModel.getDependencies().size(), is(2));
threatProtectionDependency = pomModel.getDependencies().get(1);
assertThat(threatProtectionDependency.getArtifactId(), is(MULE_JSON_THREAT_PROTECTION_EXTENSION_ARTIFACT_ID));
}
assertThat(threatProtectionDependency.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
assertThat(threatProtectionDependency.getVersion(), is(notNullValue()));
assertThat(threatProtectionDependency.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
}
Aggregations