Search in sources :

Example 11 with Dependency

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));
}
Also used : PomModel(com.mulesoft.tools.migration.project.model.pom.PomModel) Dependency(com.mulesoft.tools.migration.project.model.pom.Dependency)

Example 12 with Dependency

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));
}
Also used : PomModel(com.mulesoft.tools.migration.project.model.pom.PomModel) Dependency(com.mulesoft.tools.migration.project.model.pom.Dependency) Test(org.junit.Test)

Example 13 with Dependency

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));
}
Also used : Element(org.jdom2.Element) PomModel(com.mulesoft.tools.migration.project.model.pom.PomModel) SetPropertyMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.mule.SetPropertyMigrationStep) Dependency(com.mulesoft.tools.migration.project.model.pom.Dependency) Test(org.junit.Test)

Example 14 with Dependency

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);
}
Also used : DependencyBuilder(com.mulesoft.tools.migration.project.model.pom.Dependency.DependencyBuilder) Dependency(com.mulesoft.tools.migration.project.model.pom.Dependency)

Example 15 with Dependency

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));
}
Also used : PomModel(com.mulesoft.tools.migration.project.model.pom.PomModel) Dependency(com.mulesoft.tools.migration.project.model.pom.Dependency)

Aggregations

Dependency (com.mulesoft.tools.migration.project.model.pom.Dependency)30 PomModel (com.mulesoft.tools.migration.project.model.pom.PomModel)24 Test (org.junit.Test)16 Element (org.jdom2.Element)10 MigrationReport (com.mulesoft.tools.migration.step.category.MigrationReport)6 DependencyBuilder (com.mulesoft.tools.migration.project.model.pom.Dependency.DependencyBuilder)2 com.mulesoft.tools (com.mulesoft.tools)1 ClientIdEnforcementPomContributionMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.clientidenforcement.ClientIdEnforcementPomContributionMigrationStep)1 FederationPomContributionMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.federation.FederationPomContributionMigrationStep)1 IpFilterPomContributionMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.ipfilter.IpFilterPomContributionMigrationStep)1 HttpTransformPomContributionMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.mule.HttpTransformPomContributionMigrationStep)1 SetPropertyMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.mule.SetPropertyMigrationStep)1 JsonPolicyTagMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.threatprotection.JsonPolicyTagMigrationStep)1 XmlPolicyTagMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.threatprotection.XmlPolicyTagMigrationStep)1 FixedTimeFrameAlgorithmMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.throttling.FixedTimeFrameAlgorithmMigrationStep)1 SlaBasedAlgorithmMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.throttling.SlaBasedAlgorithmMigrationStep)1 PluginsVersions.targetVersion (com.mulesoft.tools.migration.library.tools.PluginsVersions.targetVersion)1 DefaultMelCompatibilityResolver (com.mulesoft.tools.migration.library.tools.mel.DefaultMelCompatibilityResolver)1 MelCompatibilityResolver (com.mulesoft.tools.migration.library.tools.mel.MelCompatibilityResolver)1 ApplicationModel (com.mulesoft.tools.migration.project.model.ApplicationModel)1