Search in sources :

Example 1 with HttpMigrationTask

use of com.mulesoft.tools.migration.library.gateway.tasks.HttpMigrationTask in project mule-migration-assistant by mulesoft.

the class MigrationTaskLocator method getGatewayMigrationTasks.

protected List<AbstractMigrationTask> getGatewayMigrationTasks() {
    List<AbstractMigrationTask> gatewayMigrationTasks = new ArrayList<>();
    gatewayMigrationTasks.add(new ProxyMigrationTask());
    gatewayMigrationTasks.add(new RamlProxyMigrationTask());
    gatewayMigrationTasks.add(new IpFilterMigrationTask());
    gatewayMigrationTasks.add(new ThreatProtectionMigrationTask());
    gatewayMigrationTasks.add(new ThrottlingMigrationTask());
    gatewayMigrationTasks.add(new ClientIdEnforcementMigrationTask());
    gatewayMigrationTasks.add(new FederationMigrationTask());
    gatewayMigrationTasks.add(new HttpMigrationTask());
    gatewayMigrationTasks.add(new MuleElementsMigrationTask());
    gatewayMigrationTasks.add(new PolicyUtilsMigrationTask());
    gatewayMigrationTasks.add(new BasicStructureMigrationTask());
    return gatewayMigrationTasks;
}
Also used : FederationMigrationTask(com.mulesoft.tools.migration.library.gateway.tasks.FederationMigrationTask) PolicyUtilsMigrationTask(com.mulesoft.tools.migration.library.gateway.tasks.PolicyUtilsMigrationTask) AbstractMigrationTask(com.mulesoft.tools.migration.task.AbstractMigrationTask) IpFilterMigrationTask(com.mulesoft.tools.migration.library.gateway.tasks.IpFilterMigrationTask) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) ArrayList(java.util.ArrayList) ClientIdEnforcementMigrationTask(com.mulesoft.tools.migration.library.gateway.tasks.ClientIdEnforcementMigrationTask) RamlProxyMigrationTask(com.mulesoft.tools.migration.library.gateway.tasks.RamlProxyMigrationTask) BasicStructureMigrationTask(com.mulesoft.tools.migration.library.gateway.tasks.BasicStructureMigrationTask) RamlProxyMigrationTask(com.mulesoft.tools.migration.library.gateway.tasks.RamlProxyMigrationTask) ProxyMigrationTask(com.mulesoft.tools.migration.library.gateway.tasks.ProxyMigrationTask) ThreatProtectionMigrationTask(com.mulesoft.tools.migration.library.gateway.tasks.ThreatProtectionMigrationTask) ThrottlingMigrationTask(com.mulesoft.tools.migration.library.gateway.tasks.ThrottlingMigrationTask) HttpMigrationTask(com.mulesoft.tools.migration.library.gateway.tasks.HttpMigrationTask) MuleElementsMigrationTask(com.mulesoft.tools.migration.library.gateway.tasks.MuleElementsMigrationTask)

Example 2 with HttpMigrationTask

use of com.mulesoft.tools.migration.library.gateway.tasks.HttpMigrationTask in project mule-migration-assistant by mulesoft.

the class HttpMigrationTaskTestCase method setUp.

@Before
public void setUp() throws Exception {
    ApplicationModel.ApplicationModelBuilder amb = new ApplicationModel.ApplicationModelBuilder();
    amb.withProjectType(ProjectType.MULE_THREE_POLICY);
    amb.withProjectBasePath(APPLICATION_MODEL_PATH);
    amb.withPom(POM_PATH);
    appModel = amb.build();
    doc = getDocument(this.getClass().getClassLoader().getResource(configPath.toString()).toURI().getPath());
    HttpMigrationTask task = new HttpMigrationTask();
    task.setApplicationModel(appModel);
    steps = task.getSteps();
}
Also used : ApplicationModel(com.mulesoft.tools.migration.project.model.ApplicationModel) HttpMigrationTask(com.mulesoft.tools.migration.library.gateway.tasks.HttpMigrationTask) Before(org.junit.Before)

Example 3 with HttpMigrationTask

use of com.mulesoft.tools.migration.library.gateway.tasks.HttpMigrationTask in project mule-migration-assistant by mulesoft.

the class HttpPolicyMigrationTestCase method setUp.

@Before
public void setUp() throws Exception {
    ApplicationModel.ApplicationModelBuilder amb = new ApplicationModel.ApplicationModelBuilder();
    amb.withProjectType(ProjectType.MULE_THREE_POLICY);
    amb.withProjectBasePath(POLICY_APPLICATION_MODEL_PATH);
    appModel = amb.build();
    doc = getDocument(this.getClass().getClassLoader().getResource(configPath.toString()).toURI().getPath());
    HttpMigrationTask task = new HttpMigrationTask();
    task.setApplicationModel(appModel);
    steps = task.getSteps().stream().filter(step -> step instanceof AbstractApplicationModelMigrationStep).collect(toList());
    BasicStructureMigrationTask basicStructureTask = new BasicStructureMigrationTask();
    basicStructureTask.setApplicationModel(appModel);
    List<MigrationStep> basicStructureSteps = basicStructureTask.getSteps().stream().filter(step -> step instanceof AbstractApplicationModelMigrationStep).collect(toList());
    steps.addAll(basicStructureSteps);
}
Also used : RunWith(org.junit.runner.RunWith) ApplicationModel(com.mulesoft.tools.migration.project.model.ApplicationModel) POLICY_APPLICATION_MODEL_PATH(com.mulesoft.tools.migration.library.gateway.TestConstants.POLICY_APPLICATION_MODEL_PATH) Document(org.jdom2.Document) MigrationStep(com.mulesoft.tools.migration.step.MigrationStep) Arrays.asList(java.util.Arrays.asList) After(org.junit.After) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) BasicStructureMigrationTask(com.mulesoft.tools.migration.library.gateway.tasks.BasicStructureMigrationTask) Path(java.nio.file.Path) DocumentHelper.getDocument(com.mulesoft.tools.migration.library.gateway.tasks.DocumentHelper.getDocument) Parameterized(org.junit.runners.Parameterized) Before(org.junit.Before) MIGRATION_RESOURCES_PATH(com.mulesoft.tools.migration.library.gateway.TestConstants.MIGRATION_RESOURCES_PATH) Format(org.jdom2.output.Format) UTF_8(java.nio.charset.StandardCharsets.UTF_8) Collection(java.util.Collection) Test(org.junit.Test) ProjectType(com.mulesoft.tools.migration.project.ProjectType) MigrationReport(com.mulesoft.tools.migration.step.category.MigrationReport) File(java.io.File) XMLOutputter(org.jdom2.output.XMLOutputter) CompareMatcher.isSimilarTo(org.xmlunit.matchers.CompareMatcher.isSimilarTo) IOUtils(org.apache.commons.io.IOUtils) Collectors.toList(java.util.stream.Collectors.toList) List(java.util.List) DocumentHelper.getElementsFromDocument(com.mulesoft.tools.migration.library.gateway.tasks.DocumentHelper.getElementsFromDocument) AbstractApplicationModelMigrationStep(com.mulesoft.tools.migration.step.AbstractApplicationModelMigrationStep) POLICY_EXAMPLES_PATH(com.mulesoft.tools.migration.library.gateway.TestConstants.POLICY_EXAMPLES_PATH) HttpMigrationTask(com.mulesoft.tools.migration.library.gateway.tasks.HttpMigrationTask) Mockito.mock(org.mockito.Mockito.mock) MigrationStep(com.mulesoft.tools.migration.step.MigrationStep) AbstractApplicationModelMigrationStep(com.mulesoft.tools.migration.step.AbstractApplicationModelMigrationStep) ApplicationModel(com.mulesoft.tools.migration.project.model.ApplicationModel) AbstractApplicationModelMigrationStep(com.mulesoft.tools.migration.step.AbstractApplicationModelMigrationStep) BasicStructureMigrationTask(com.mulesoft.tools.migration.library.gateway.tasks.BasicStructureMigrationTask) HttpMigrationTask(com.mulesoft.tools.migration.library.gateway.tasks.HttpMigrationTask) Before(org.junit.Before)

Aggregations

HttpMigrationTask (com.mulesoft.tools.migration.library.gateway.tasks.HttpMigrationTask)3 BasicStructureMigrationTask (com.mulesoft.tools.migration.library.gateway.tasks.BasicStructureMigrationTask)2 ApplicationModel (com.mulesoft.tools.migration.project.model.ApplicationModel)2 Before (org.junit.Before)2 Lists.newArrayList (com.google.common.collect.Lists.newArrayList)1 MIGRATION_RESOURCES_PATH (com.mulesoft.tools.migration.library.gateway.TestConstants.MIGRATION_RESOURCES_PATH)1 POLICY_APPLICATION_MODEL_PATH (com.mulesoft.tools.migration.library.gateway.TestConstants.POLICY_APPLICATION_MODEL_PATH)1 POLICY_EXAMPLES_PATH (com.mulesoft.tools.migration.library.gateway.TestConstants.POLICY_EXAMPLES_PATH)1 ClientIdEnforcementMigrationTask (com.mulesoft.tools.migration.library.gateway.tasks.ClientIdEnforcementMigrationTask)1 DocumentHelper.getDocument (com.mulesoft.tools.migration.library.gateway.tasks.DocumentHelper.getDocument)1 DocumentHelper.getElementsFromDocument (com.mulesoft.tools.migration.library.gateway.tasks.DocumentHelper.getElementsFromDocument)1 FederationMigrationTask (com.mulesoft.tools.migration.library.gateway.tasks.FederationMigrationTask)1 IpFilterMigrationTask (com.mulesoft.tools.migration.library.gateway.tasks.IpFilterMigrationTask)1 MuleElementsMigrationTask (com.mulesoft.tools.migration.library.gateway.tasks.MuleElementsMigrationTask)1 PolicyUtilsMigrationTask (com.mulesoft.tools.migration.library.gateway.tasks.PolicyUtilsMigrationTask)1 ProxyMigrationTask (com.mulesoft.tools.migration.library.gateway.tasks.ProxyMigrationTask)1 RamlProxyMigrationTask (com.mulesoft.tools.migration.library.gateway.tasks.RamlProxyMigrationTask)1 ThreatProtectionMigrationTask (com.mulesoft.tools.migration.library.gateway.tasks.ThreatProtectionMigrationTask)1 ThrottlingMigrationTask (com.mulesoft.tools.migration.library.gateway.tasks.ThrottlingMigrationTask)1 ProjectType (com.mulesoft.tools.migration.project.ProjectType)1