Search in sources :

Example 1 with PointcutTagMigrationStep

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

the class PointcutTagMigrationStepTestCase method convertRawPointcutTag.

@Test
public void convertRawPointcutTag() {
    final PointcutTagMigrationStep step = new PointcutTagMigrationStep();
    step.setApplicationModel(appModel);
    Element element = getTestElement();
    step.execute(element, reportMock);
    assertProxyAndSourceElements(element, 1);
    assertExecuteNextElement((Element) element.getContent(0), 0);
    verify(reportMock).report("basicStructure.pointcutMigrationStepUnknown", element, element, "Unknown");
}
Also used : Element(org.jdom2.Element) PointcutTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PointcutTagMigrationStep) Test(org.junit.Test)

Example 2 with PointcutTagMigrationStep

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

the class PointcutTagMigrationStepTestCase method convertResourcePoinctuTag.

@Test
public void convertResourcePoinctuTag() {
    final PointcutTagMigrationStep step = new PointcutTagMigrationStep();
    step.setApplicationModel(appModel);
    Element element = getTestElement().addContent(new Element(API_POINTCUT_TAG_NAME, API_PLATFORM_GW_NAMESPACE).setAttribute(API_NAME_ATTR_NAME, API_NAME_ATTR_VALUE).setAttribute(API_VERSION_ATTR_NAME, API_VERSION_ATTR_VALUE)).addContent(new Element(RESOURCE_TAG_NAME).setAttribute(METHOD_REGEX_ATTR_NAME, METHOD_REGEX_ATTR_VALUE).setAttribute(URI_TEMPLATE_REGEX_ATTR_NAME, URI_TEMPLATE_REGEX_ATTR_VALUE));
    step.execute(element, reportMock);
    assertProxyAndSourceElements(element, 1);
    assertExecuteNextElement((Element) element.getContent(0), 0);
    verify(reportMock).report("basicStructure.pointcutMigrationStepResolvedByRuntime", element, element, "Resource");
}
Also used : Element(org.jdom2.Element) PointcutTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PointcutTagMigrationStep) Test(org.junit.Test)

Example 3 with PointcutTagMigrationStep

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

the class PointcutTagMigrationStepTestCase method convertAppPoinctuTag.

@Test
public void convertAppPoinctuTag() {
    final PointcutTagMigrationStep step = new PointcutTagMigrationStep();
    step.setApplicationModel(appModel);
    Element element = getTestElement().addContent(new Element(APP_TAG_NAME).setAttribute(REGEX_ATTR_NAME, REGEX_ATTR_VALUE));
    step.execute(element, reportMock);
    assertProxyAndSourceElements(element, 1);
    assertExecuteNextElement((Element) element.getContent(0), 0);
    verify(reportMock).report("basicStructure.pointcutMigrationStepNoEquivalent", element, element, "App");
}
Also used : Element(org.jdom2.Element) PointcutTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PointcutTagMigrationStep) Test(org.junit.Test)

Example 4 with PointcutTagMigrationStep

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

the class BasicStructureMigrationTask method getSteps.

@Override
public List<MigrationStep> getSteps() {
    PolicyFileRenameMigrationStep policyFileRenameMigrationStep = new PolicyFileRenameMigrationStep();
    policyFileRenameMigrationStep.setApplicationModel(getApplicationModel());
    List<MigrationStep> steps = new ArrayList<>();
    steps.add(new PolicyTagMigrationStep());
    steps.add(new BeforeTagMigrationStep());
    steps.add(new AfterTagMigrationStep());
    steps.add(new BeforeExceptionTagMigrationStep());
    steps.add(new AfterExceptionTagMigrationStep());
    steps.add(new PointcutTagMigrationStep());
    steps.add(new DataTagMigrationStep());
    steps.add(new CleanupAttributesMigrationStep());
    steps.add(policyFileRenameMigrationStep);
    return steps;
}
Also used : BeforeExceptionTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeExceptionTagMigrationStep) AfterExceptionTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.AfterExceptionTagMigrationStep) BeforeTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeTagMigrationStep) AfterExceptionTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.AfterExceptionTagMigrationStep) PolicyFileRenameMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyFileRenameMigrationStep) AfterTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.AfterTagMigrationStep) PointcutTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PointcutTagMigrationStep) BeforeTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeTagMigrationStep) BeforeExceptionTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeExceptionTagMigrationStep) PolicyTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyTagMigrationStep) CleanupAttributesMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.CleanupAttributesMigrationStep) MigrationStep(com.mulesoft.tools.migration.step.MigrationStep) DataTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.DataTagMigrationStep) ArrayList(java.util.ArrayList) DataTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.DataTagMigrationStep) PolicyFileRenameMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyFileRenameMigrationStep) PolicyTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyTagMigrationStep) AfterTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.AfterTagMigrationStep) CleanupAttributesMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.CleanupAttributesMigrationStep) PointcutTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PointcutTagMigrationStep)

Example 5 with PointcutTagMigrationStep

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

the class PointcutTagMigrationStepTestCase method convertApiPlatformPoinctuTag.

@Test
public void convertApiPlatformPoinctuTag() {
    final PointcutTagMigrationStep step = new PointcutTagMigrationStep();
    step.setApplicationModel(appModel);
    Element element = getTestElement().addContent(new Element(API_POINTCUT_TAG_NAME, API_PLATFORM_GW_NAMESPACE).setAttribute(API_NAME_ATTR_NAME, API_NAME_ATTR_VALUE).setAttribute(API_VERSION_ATTR_NAME, API_VERSION_ATTR_VALUE));
    step.execute(element, reportMock);
    assertProxyAndSourceElements(element, 1);
    assertExecuteNextElement((Element) element.getContent(0), 0);
    verify(reportMock).report("basicStructure.pointcutMigrationStepResolvedByRuntime", element, element, "Api");
}
Also used : Element(org.jdom2.Element) PointcutTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PointcutTagMigrationStep) Test(org.junit.Test)

Aggregations

PointcutTagMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PointcutTagMigrationStep)6 Element (org.jdom2.Element)5 Test (org.junit.Test)5 AfterExceptionTagMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.AfterExceptionTagMigrationStep)1 AfterTagMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.AfterTagMigrationStep)1 BeforeExceptionTagMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeExceptionTagMigrationStep)1 BeforeTagMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeTagMigrationStep)1 CleanupAttributesMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.CleanupAttributesMigrationStep)1 DataTagMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.DataTagMigrationStep)1 PolicyFileRenameMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyFileRenameMigrationStep)1 PolicyTagMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyTagMigrationStep)1 MigrationStep (com.mulesoft.tools.migration.step.MigrationStep)1 ArrayList (java.util.ArrayList)1