Search in sources :

Example 6 with SetPropertyMigrationStep

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

the class SetPropertyMigrationStepTestCase method doubleSetPropertyElement.

@Test
public void doubleSetPropertyElement() {
    SetPropertyMigrationStep step = new SetPropertyMigrationStep();
    step.setApplicationModel(appModel);
    Element firstSetPropertyElement = getTestElement();
    Element secondSetPropertyElement = getTestElement();
    Element rootElement = setDocument(firstSetPropertyElement, secondSetPropertyElement);
    step.execute(firstSetPropertyElement, reportMock);
    step.execute(secondSetPropertyElement, reportMock);
    assertTestElementIsNotModified(firstSetPropertyElement);
    assertTestElementIsNotModified(secondSetPropertyElement);
    assertThat(rootElement.getContentSize(), is(4));
    assertThat(((Element) rootElement.getContent(0)).getName(), is(SET_PROPERTY_TAG_NAME));
    assertThat(((Element) rootElement.getContent(1)).getName(), is(SET_PROPERTY_TAG_NAME));
    assertOutboundPropertiesToVarElement((Element) rootElement.getContent(2));
    assertSetResponseElement((Element) rootElement.getContent(3));
}
Also used : Element(org.jdom2.Element) SetPropertyMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.mule.SetPropertyMigrationStep) Test(org.junit.Test)

Example 7 with SetPropertyMigrationStep

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

the class MuleElementsMigrationTask method getSteps.

@Override
public List<MigrationStep> getSteps() {
    SetPropertyMigrationStep step = new SetPropertyMigrationStep();
    step.setApplicationModel(getApplicationModel());
    return Arrays.asList(step);
}
Also used : SetPropertyMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.mule.SetPropertyMigrationStep)

Example 8 with SetPropertyMigrationStep

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

the class SetPropertyMigrationStepTestCase method nestedSetPropertyElementInnerMigrated.

@Test
public void nestedSetPropertyElementInnerMigrated() {
    SetPropertyMigrationStep step = new SetPropertyMigrationStep();
    step.setApplicationModel(appModel);
    Element firstSetPropertyElement = getTestElement();
    Element genericElement = new Element(GENERIC_TAG_NAME, MULE_4_POLICY_NAMESPACE);
    Element secondSetPropertyElement = getTestElement();
    genericElement.addContent(Arrays.asList(secondSetPropertyElement, getOutboundPropertiesToVarElement(), getSetResponseElement()));
    Element rootElement = setDocument(firstSetPropertyElement, genericElement);
    step.execute(firstSetPropertyElement, reportMock);
    performNestedElementTestsAssertions(rootElement, 4, 2, 3, 1, 3);
    step.execute(secondSetPropertyElement, reportMock);
    performNestedElementTestsAssertions(rootElement, 4, 2, 3, 1, 3);
}
Also used : Element(org.jdom2.Element) SetPropertyMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.mule.SetPropertyMigrationStep) Test(org.junit.Test)

Example 9 with SetPropertyMigrationStep

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

the class SetPropertyMigrationStepTestCase method nestedSetPropertyElementOuterMigrated.

@Test
public void nestedSetPropertyElementOuterMigrated() {
    SetPropertyMigrationStep step = new SetPropertyMigrationStep();
    step.setApplicationModel(appModel);
    Element firstSetPropertyElement = getTestElement();
    Element secondSetPropertyElement = getTestElement();
    Element genericElement = new Element(GENERIC_TAG_NAME, MULE_4_POLICY_NAMESPACE).addContent(secondSetPropertyElement);
    Element rootElement = setDocument(firstSetPropertyElement, getOutboundPropertiesToVarElement(), getSetResponseElement(), genericElement);
    step.execute(firstSetPropertyElement, reportMock);
    performNestedElementTestsAssertions(rootElement, 4, 1, 2, 3, 1);
    step.execute(secondSetPropertyElement, reportMock);
    performNestedElementTestsAssertions(rootElement, 4, 1, 2, 3, 3);
}
Also used : Element(org.jdom2.Element) SetPropertyMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.mule.SetPropertyMigrationStep) Test(org.junit.Test)

Aggregations

SetPropertyMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.mule.SetPropertyMigrationStep)9 Element (org.jdom2.Element)8 Test (org.junit.Test)8 Dependency (com.mulesoft.tools.migration.project.model.pom.Dependency)1 PomModel (com.mulesoft.tools.migration.project.model.pom.PomModel)1