Search in sources :

Example 26 with Dependency

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

the class ProxyRequestHeadersProcessorMigrationStepTestCase method migrateElementAndPomTest.

@Test
public void migrateElementAndPomTest() throws Exception {
    final ProxyRequestHeadersProcessorMigrationStep step = new ProxyRequestHeadersProcessorMigrationStep();
    Element element = appModel.getNode(XPATH_NODE_EXPRESSION);
    step.setApplicationModel(appModel);
    step.execute(element, reportMock);
    assertThat(element.getName(), is(REQUEST_HEADERS));
    assertThat(element.getNamespace(), is(PROXY_NAMESPACE));
    assertThat(element.getAttributes().size(), is(2));
    assertThat(element.getAttribute(CONFIG_REF).getValue(), is(PROXY_CONFIG));
    assertThat(element.getAttribute(TARGET).getValue(), is(PROXY_REQUEST_HEADERS));
    assertThat(element.getContent().size(), is(0));
    assertConfigElement(element);
    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 : 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 27 with Dependency

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

the class ProxyResponseHeadersProcessorMigrationStepTestCase method migrateElementAndPomTest.

@Test
public void migrateElementAndPomTest() throws Exception {
    final ProxyResponseHeadersProcessorMigrationStep step = new ProxyResponseHeadersProcessorMigrationStep();
    Element element = appModel.getNode(XPATH_NODE_EXPRESSION);
    step.setApplicationModel(appModel);
    step.execute(element, reportMock);
    assertThat(element.getName(), is(RESPONSE_HEADERS));
    assertThat(element.getNamespace(), is(PROXY_NAMESPACE));
    assertThat(element.getAttributes().size(), is(2));
    assertThat(element.getAttribute(CONFIG_REF).getValue(), is(PROXY_CONFIG));
    assertThat(element.getAttribute(TARGET).getValue(), is(PROXY_RESPONSE_HEADERS));
    assertThat(element.getContent().size(), is(0));
    assertConfigElement(element);
    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 : 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 28 with Dependency

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

the class IpFilterPomContributionMigrationStepTestCase method pomContributionTest.

@Test
public void pomContributionTest() {
    PomModel pm = new PomModel();
    IpFilterPomContributionMigrationStep step = new IpFilterPomContributionMigrationStep();
    step.execute(pm, reportMock);
    assertThat(pm.getDependencies().size(), is(1));
    Dependency ipFilterExtension = pm.getDependencies().get(0);
    assertThat(ipFilterExtension.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
    assertThat(ipFilterExtension.getArtifactId(), is(MULE_IP_FILTER_EXTENSION_ARTIFACT_ID));
    assertThat(ipFilterExtension.getVersion(), is(notNullValue()));
    assertThat(ipFilterExtension.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
}
Also used : IpFilterPomContributionMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.ipfilter.IpFilterPomContributionMigrationStep) PomModel(com.mulesoft.tools.migration.project.model.pom.PomModel) Dependency(com.mulesoft.tools.migration.project.model.pom.Dependency) Test(org.junit.Test)

Example 29 with Dependency

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

the class HttpTransformPomContributionMigrationStepTestCase method pomContributionTest.

@Test
public void pomContributionTest() {
    PomModel pm = new PomModel();
    HttpTransformPomContributionMigrationStep step = new HttpTransformPomContributionMigrationStep();
    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_HTTP_POLICY_TRANSFORM_EXTENSION_ARTIFACT_ID));
    assertThat(httpPolicyTransformExtension.getVersion(), is(notNullValue()));
    assertThat(httpPolicyTransformExtension.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
}
Also used : HttpTransformPomContributionMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.mule.HttpTransformPomContributionMigrationStep) 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 30 with Dependency

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

the class DWWsdlPropertyAttributeValueMigrationStepTestCase method wsdlPomContributionTest.

@Test
public void wsdlPomContributionTest() throws Exception {
    final DWWsdlPropertyAttributeValueMigrationStep step = new DWWsdlPropertyAttributeValueMigrationStep();
    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 wsdlExtensionDependency = pm.getDependencies().get(0);
    assertThat(wsdlExtensionDependency.getGroupId(), is(COM_MULESOFT_ANYPOINT_GROUP_ID));
    assertThat(wsdlExtensionDependency.getArtifactId(), is(MULE_WSDL_FUNCTIONS_EXTENSION_ARTIFACT_ID));
    assertThat(wsdlExtensionDependency.getVersion(), is(notNullValue()));
    assertThat(wsdlExtensionDependency.getClassifier(), is(MULE_PLUGIN_CLASSIFIER));
    assertThat(element.getAttributeValue(PORT_ATTRIBUTE), is(EXPECTED_FUNCTION_PORT));
    assertThat(element.getAttributeValue(HOST_ATTRIBUTE), is(EXPECTED_FUNCTION_HOST));
}
Also used : 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)

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