Search in sources :

Example 21 with Dependency

use of com.mulesoft.tools.migration.project.model.pom.Dependency in project mule-migration-assistant by mulesoft.

the class RamlValidatorPomContributionMigrationStepTestCase method pomContributionTestWithNoPreviousDependency.

@Test
public void pomContributionTestWithNoPreviousDependency() {
    PomModel pm = new PomModel();
    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));
}
Also used : PomModel(com.mulesoft.tools.migration.project.model.pom.PomModel) MigrationReport(com.mulesoft.tools.migration.step.category.MigrationReport) Dependency(com.mulesoft.tools.migration.project.model.pom.Dependency) Test(org.junit.Test)

Example 22 with Dependency

use of com.mulesoft.tools.migration.project.model.pom.Dependency in project mule-migration-assistant by mulesoft.

the class JsonPolicyTagMigrationStepTestCase method jsonPomContributionTest.

@Test
public void jsonPomContributionTest() {
    JsonPolicyTagMigrationStep step = new JsonPolicyTagMigrationStep();
    step.setApplicationModel(appModel);
    Element element = appModel.getNode(XPATH_NODE_EXPRESSION);
    step.execute(element, reportMock);
    PomModel pm = appModel.getPomModel().get();
    assertThat(pm.getDependencies().size(), is(1));
    Dependency jsonThreatProtectionDependency = pm.getDependencies().get(0);
    assertThat(jsonThreatProtectionDependency.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
    assertThat(jsonThreatProtectionDependency.getArtifactId(), is(MULE_JSON_THREAT_PROTECTION_EXTENSION_ARTIFACT_ID));
    assertThat(jsonThreatProtectionDependency.getVersion(), is(notNullValue()));
    assertThat(jsonThreatProtectionDependency.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
    assertJsonPolicyTag(element);
}
Also used : JsonPolicyTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.threatprotection.JsonPolicyTagMigrationStep) Element(org.jdom2.Element) PomModel(com.mulesoft.tools.migration.project.model.pom.PomModel) Dependency(com.mulesoft.tools.migration.project.model.pom.Dependency) Test(org.junit.Test)

Example 23 with Dependency

use of com.mulesoft.tools.migration.project.model.pom.Dependency in project mule-migration-assistant by mulesoft.

the class ThrottlingWithFileRenameMigrationTestCase method assertPomModel.

private void assertPomModel() {
    PomModel pomModel = appModel.getPomModel().get();
    assertThat(pomModel.getDependencies().size(), is(2));
    Dependency httpTransformDependency = pomModel.getDependencies().get(0);
    assertThat(httpTransformDependency.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
    assertThat(httpTransformDependency.getArtifactId(), is(MULE_HTTP_POLICY_TRANSFORM_EXTENSION_ARTIFACT_ID));
    assertThat(httpTransformDependency.getVersion(), is(notNullValue()));
    assertThat(httpTransformDependency.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
    Dependency policyTransformExtensionDependency = pomModel.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));
    assertPomDeployProperties(pomModel);
}
Also used : PomModel(com.mulesoft.tools.migration.project.model.pom.PomModel) Dependency(com.mulesoft.tools.migration.project.model.pom.Dependency)

Example 24 with Dependency

use of com.mulesoft.tools.migration.project.model.pom.Dependency in project mule-migration-assistant by mulesoft.

the class FederationPomContributionMigrationStepTestCase method pomContributionTest.

@Test
public void pomContributionTest() {
    MigrationReport reportMock = reportMock = mock(MigrationReport.class);
    PomModel pm = new PomModel();
    FederationPomContributionMigrationStep step = new FederationPomContributionMigrationStep();
    step.execute(pm, reportMock);
    assertThat(pm.getDependencies().size(), is(2));
    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));
    Dependency federationExtensionDependency = pm.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 : FederationPomContributionMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.federation.FederationPomContributionMigrationStep) MigrationReport(com.mulesoft.tools.migration.step.category.MigrationReport) PomModel(com.mulesoft.tools.migration.project.model.pom.PomModel) Dependency(com.mulesoft.tools.migration.project.model.pom.Dependency) Test(org.junit.Test)

Example 25 with Dependency

use of com.mulesoft.tools.migration.project.model.pom.Dependency in project mule-migration-assistant by mulesoft.

the class ProxyRequestHeadersProcessorMigrationStepTestCase 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)

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