use of com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyTagMigrationStep 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.PolicyTagMigrationStep in project mule-migration-assistant by mulesoft.
the class PolicyTagMigrationStepTestCase method convertPolicyKeepingContent.
@Test
public void convertPolicyKeepingContent() {
final PolicyTagMigrationStep step = new PolicyTagMigrationStep();
Element element = getTestElement().addContent(new Element(GENERIC_TAG_NAME).setText(GENERIC_TAG_VALUE).setAttribute(GENERIC_TAG_ATTRIBUTE_NAME, GENERIC_TAG_ATTRIBUTE_VALUE).setNamespace(GENERIC_NAMESPACE));
step.execute(element, reportMock);
assertMuleTagName(element, true);
assertThat(element.getAttribute(SCHEMA_LOCATION, XSI_NAMESPACE).getValue(), is(new Attribute(SCHEMA_LOCATION, MULE_4_XSI_SCHEMA_LOCATION_URI, XSI_NAMESPACE).getValue()));
final Element genericElement = (Element) element.getContent().get(0);
assertThat(genericElement.getParentElement().getName(), is(MULE_TAG_NAME));
assertThat(genericElement.getParentElement().getNamespaceURI(), is(MULE_4_NAMESPACE_URI));
assertThat(genericElement.getValue(), is(GENERIC_TAG_VALUE));
assertThat(genericElement.getCType().name(), is(Element.class.getSimpleName()));
assertThat(genericElement.getNamespacesIntroduced().size(), is(2));
assertThat(getElementNamespaces(element), is(GENERIC_NAMESPACE_URI));
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyTagMigrationStep in project mule-migration-assistant by mulesoft.
the class PolicyTagMigrationStepTestCase method convertRawPolicy.
@Test
public void convertRawPolicy() {
final PolicyTagMigrationStep step = new PolicyTagMigrationStep();
Element element = getTestElement();
step.execute(element, reportMock);
assertMuleTagName(element, false);
}
Aggregations