use of com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeTagMigrationStep in project mule-migration-assistant by mulesoft.
the class BeforeTagMigrationStepTestCase method setDefaultPolicyName.
@Test
public void setDefaultPolicyName() {
final BeforeTagMigrationStep step = new BeforeTagMigrationStep();
step.setApplicationModel(appModel);
Element element = getTestElement();
step.execute(element, reportMock);
assertThat(element.getAttributeValue(NAME), is("basic-structure-policy"));
verify(reportMock).report("basicStructure.defaultPolicyName", element, element, "basic-structure-policy");
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeTagMigrationStep 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;
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeTagMigrationStep in project mule-migration-assistant by mulesoft.
the class BeforeTagMigrationStepTestCase method convertBeforeTagWithContent.
@Test
public void convertBeforeTagWithContent() {
final BeforeTagMigrationStep step = new BeforeTagMigrationStep();
step.setApplicationModel(appModel);
Element element = getTestElement().addContent(new Element(GENERIC_TAG_NAME).setText(GENERIC_TAG_VALUE).setAttribute(GENERIC_TAG_ATTRIBUTE_NAME, GENERIC_TAG_ATTRIBUTE_VALUE));
step.execute(element, reportMock);
assertProxyAndSourceElements(element, 2);
final Element source = (Element) element.getContent(0);
final Element contentElement = (Element) source.getContent(0);
assertThat(contentElement.getParentElement().getName(), is(SOURCE_TAG_NAME));
assertThat(contentElement.getParentElement().getNamespacePrefix(), is(HTTP_POLICY_NAMESPACE_PREFIX));
assertThat(contentElement.getValue(), is(GENERIC_TAG_VALUE));
assertThat(contentElement.getCType().name(), is(Element.class.getSimpleName()));
assertThat(contentElement.getNamespacesIntroduced().size(), is(1));
assertExecuteNextElement((Element) element.getContent(0), 1);
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeTagMigrationStep in project mule-migration-assistant by mulesoft.
the class BeforeTagMigrationStepTestCase method convertRawBeforeTag.
@Test
public void convertRawBeforeTag() {
final BeforeTagMigrationStep step = new BeforeTagMigrationStep();
step.setApplicationModel(appModel);
Element element = getTestElement();
step.execute(element, reportMock);
assertProxyAndSourceElements(element, 1);
assertExecuteNextElement((Element) element.getContent(0), 0);
}
Aggregations