use of com.mulesoft.tools.migration.library.gateway.steps.policy.throttling.SlaBasedAlgorithmMigrationStep in project mule-migration-assistant by mulesoft.
the class SlaBasedAlgorithmMigrationStepTestCase method oneRateLimitSLAElementSpikeControl.
@Test
public void oneRateLimitSLAElementSpikeControl() {
SlaBasedAlgorithmMigrationStep step = new SlaBasedAlgorithmMigrationStep();
step.setApplicationModel(appModel);
Element element = getSlaPolicy(1, false);
step.execute(element, reportMock);
assertConfigElement(element, 1, false);
assertOperationElements(element, 1, false);
assertNamespaces(element);
verify(reportMock).report("throttling.throttlingSLANotSupported", element.getParentElement(), element.getParentElement());
assertPolicyName(element);
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.throttling.SlaBasedAlgorithmMigrationStep in project mule-migration-assistant by mulesoft.
the class SlaBasedAlgorithmMigrationStepTestCase method oneRateLimitSLAElement.
@Test
public void oneRateLimitSLAElement() {
SlaBasedAlgorithmMigrationStep step = new SlaBasedAlgorithmMigrationStep();
step.setApplicationModel(appModel);
Element element = getSlaPolicy(1, true);
step.execute(element, reportMock);
assertConfigElement(element, 1, true);
assertOperationElements(element, 1, true);
assertNamespaces(element);
assertPolicyName(element);
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.throttling.SlaBasedAlgorithmMigrationStep in project mule-migration-assistant by mulesoft.
the class ThrottlingMigrationTask method getSteps.
@Override
public List<MigrationStep> getSteps() {
FixedTimeFrameAlgorithmMigrationStep fixedTimeFrameAlgorithmMigrationStep = new FixedTimeFrameAlgorithmMigrationStep();
fixedTimeFrameAlgorithmMigrationStep.setApplicationModel(getApplicationModel());
SlaBasedAlgorithmMigrationStep slaBasedAlgorithmMigrationStep = new SlaBasedAlgorithmMigrationStep();
slaBasedAlgorithmMigrationStep.setApplicationModel(getApplicationModel());
List<MigrationStep> steps = new ArrayList<>();
steps.add(fixedTimeFrameAlgorithmMigrationStep);
steps.add(slaBasedAlgorithmMigrationStep);
steps.add(new RateLimitTagMigrationStep());
steps.add(new DelayResponseTagMigrationStep());
steps.add(new DiscardResponseTagMigrationStep());
steps.add(new PolicyTagMigrationStep());
steps.add(new ThrottleTagMigrationStep());
return steps;
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.throttling.SlaBasedAlgorithmMigrationStep in project mule-migration-assistant by mulesoft.
the class SlaBasedAlgorithmMigrationStepTestCase method multipleRateLimitSLAElementsSpikeControl.
@Test
public void multipleRateLimitSLAElementsSpikeControl() {
SlaBasedAlgorithmMigrationStep step = new SlaBasedAlgorithmMigrationStep();
step.setApplicationModel(appModel);
Element element = getSlaPolicy(2, false);
step.execute(element, reportMock);
assertConfigElement(element, 2, false);
assertOperationElements(element, 2, false);
assertNamespaces(element);
verify(reportMock).report("throttling.throttlingSLANotSupported", element.getParentElement(), element.getParentElement());
assertPolicyName(element);
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.throttling.SlaBasedAlgorithmMigrationStep in project mule-migration-assistant by mulesoft.
the class SlaBasedAlgorithmMigrationStepTestCase method multipleRateLimitSLAElements.
@Test
public void multipleRateLimitSLAElements() {
SlaBasedAlgorithmMigrationStep step = new SlaBasedAlgorithmMigrationStep();
step.setApplicationModel(appModel);
Element element = getSlaPolicy(2, true);
step.execute(element, reportMock);
assertConfigElement(element, 2, true);
assertOperationElements(element, 2, true);
assertNamespaces(element);
assertPolicyName(element);
}
Aggregations