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));
}
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);
}
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);
}
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);
}
Aggregations