Search in sources :

Example 1 with HttpTransformPomContributionMigrationStep

use of com.mulesoft.tools.migration.library.gateway.steps.policy.mule.HttpTransformPomContributionMigrationStep in project mule-migration-assistant by mulesoft.

the class FederationPomContributionMigrationStep method execute.

@Override
public void execute(PomModel pomModel, MigrationReport migrationReport) throws RuntimeException {
    new HttpTransformPomContributionMigrationStep().execute(pomModel, migrationReport);
    pomModel.addDependency(new DependencyBuilder().withGroupId(COM_MULESOFT_ANYPOINT_GROUP_ID).withArtifactId(MULE_FEDERATION_EXTENSION_ARTIFACT_ID).withVersion(targetVersion(FEDERATION_EXTENSION_VERSION_PROPERTY)).withClassifier(MULE_PLUGIN_CLASSIFIER).build());
}
Also used : DependencyBuilder(com.mulesoft.tools.migration.project.model.pom.Dependency.DependencyBuilder) HttpTransformPomContributionMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.mule.HttpTransformPomContributionMigrationStep)

Example 2 with HttpTransformPomContributionMigrationStep

use of com.mulesoft.tools.migration.library.gateway.steps.policy.mule.HttpTransformPomContributionMigrationStep in project mule-migration-assistant by mulesoft.

the class ThrottlingPomContributionMigrationStep method execute.

@Override
public void execute(PomModel pomModel, MigrationReport migrationReport) throws RuntimeException {
    new HttpTransformPomContributionMigrationStep().execute(pomModel, migrationReport);
    pomModel.addDependency(new Dependency.DependencyBuilder().withGroupId(COM_MULESOFT_ANYPOINT_GROUP_ID).withArtifactId(MULE_THROTTLING_EXTENSION_ARTIFACT_ID).withVersion(targetVersion(THROTTLING_EXTENSION_VERSION_PROPERTY)).withClassifier(MULE_PLUGIN_CLASSIFIER).build());
}
Also used : HttpTransformPomContributionMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.mule.HttpTransformPomContributionMigrationStep)

Example 3 with HttpTransformPomContributionMigrationStep

use of com.mulesoft.tools.migration.library.gateway.steps.policy.mule.HttpTransformPomContributionMigrationStep in project mule-migration-assistant by mulesoft.

the class AbstractResponseBuilderMigrationStep method execute.

@Override
public void execute(Element element, MigrationReport migrationReport) throws RuntimeException {
    element.setName(SET_RESPONSE_TAG_NAME);
    element.setNamespace(HTTP_TRANSFORM_NAMESPACE);
    addNamespaceDeclaration(getRootElement(element), HTTP_TRANSFORM_NAMESPACE, HTTP_TRANSFORM_XSI_SCHEMA_LOCATION_URI);
    setStatusCode(element);
    Element headersElement = new Element(HEADERS_TAG_NAME, HTTP_TRANSFORM_NAMESPACE);
    Text textElement = new Text(HEADERS_CONTENT_VALUE + getHeadersTextContentMap(element) + "]");
    headersElement.addContent(textElement);
    element.addContent(headersElement);
    com.mulesoft.tools.migration.library.mule.steps.http.HttpConnectorListener.httpListenerLib(getApplicationModel());
    new HttpTransformPomContributionMigrationStep().execute(getApplicationModel().getPomModel().get(), migrationReport);
}
Also used : Element(org.jdom2.Element) HttpTransformPomContributionMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.mule.HttpTransformPomContributionMigrationStep) Text(org.jdom2.Text)

Example 4 with HttpTransformPomContributionMigrationStep

use of com.mulesoft.tools.migration.library.gateway.steps.policy.mule.HttpTransformPomContributionMigrationStep 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)

Aggregations

HttpTransformPomContributionMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.mule.HttpTransformPomContributionMigrationStep)4 Dependency (com.mulesoft.tools.migration.project.model.pom.Dependency)1 DependencyBuilder (com.mulesoft.tools.migration.project.model.pom.Dependency.DependencyBuilder)1 PomModel (com.mulesoft.tools.migration.project.model.pom.PomModel)1 MigrationReport (com.mulesoft.tools.migration.step.category.MigrationReport)1 Element (org.jdom2.Element)1 Text (org.jdom2.Text)1 Test (org.junit.Test)1