use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project mule-migration-assistant by mulesoft.
the class AssertTrueTest method execute.
@Test
public void execute() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(MUNIT_SAMPLE_PATH.toString()).toURI().getPath());
node = getElementsFromDocument(doc, assertTrue.getAppliedTo().getExpression()).get(0);
assertTrue.execute(node, report.getReport());
assertThat("The node didn't change", node.getName(), is("assert-that"));
assertThat("The attribute didn't change", node.getAttribute("is"), is(notNullValue()));
assertThat("The attribute didn't change", node.getAttribute("is").getValue(), is("#[MunitTools::equalTo(true)]"));
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project mule-migration-assistant by mulesoft.
the class MUnitTestTest method validateTestStructure.
@Test
public void validateTestStructure() throws Exception {
Document doc = getDocument(this.getClass().getClassLoader().getResource(MUNIT_SAMPLE_PATH.toString()).toURI().getPath());
node = getElementsFromDocument(doc, munitTest.getAppliedTo().getExpression()).get(0);
munitTest.execute(node, report.getReport());
assertThat("The munit test not contains sections.", node.getChildren().size(), is(3));
assertThat("The munit test not contains sections.", node.getChildren().get(0).getName(), is("behavior"));
assertThat("The munit test not contains sections.", node.getChildren().get(1).getName(), is("execution"));
assertThat("The munit test not contains sections.", node.getChildren().get(2).getName(), is("validation"));
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project mule-migration-assistant by mulesoft.
the class AbstractThrottlingTestCase method createPolicy.
protected Element createPolicy(int rateLimitElements, String algorithmTagName, boolean isRateLimit) {
Element policy = new Element(POLICY_TAG_NAME, MULE_3_POLICY_NAMESPACE);
Element throttlingPolicy = new Element(POLICY_TAG_NAME, THROTTLING_GW_MULE_3_NAMESPACE);
throttlingPolicy.addContent(isRateLimit ? getNewElement(DISCARD_RESPONSE_TAG_NAME) : getDelayResponseElement());
Element algorithmElement = getNewElement(algorithmTagName);
IntStream.range(0, rateLimitElements).mapToObj(i -> getRateLimitElement(String.valueOf(i))).forEach(algorithmElement::addContent);
throttlingPolicy.addContent(algorithmElement);
new Document().setRootElement(policy.addContent(throttlingPolicy));
return algorithmElement;
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project mule-migration-assistant by mulesoft.
the class RamlTagMigrationStepTestCase method getTestElement.
private Element getTestElement(boolean hardCodedProperties) {
Element ramlElement = new Element(RAML, PROXY_NAMESPACE).setAttribute(CONFIG_REF, CONFIG_REF_ATTR_VALUE);
Element muleElement = new Element(MULE_TAG_NAME, MULE_4_NAMESPACE).addContent(new Element(FLOW_TAG_NAME, MULE_4_NAMESPACE).addContent(ramlElement)).addContent(new Element(RAML_PROXY_CONFIG_TAG_NAME, PROXY_NAMESPACE).setAttribute(NAME, CONFIG_REF_ATTR_VALUE).setAttribute(RAML, hardCodedProperties ? RAML_ATTR_VALUE_3X_HC : RAML_ATTR_VALUE_3X).setAttribute(DISABLE_VALIDATIONS_ATTR_NAME, hardCodedProperties ? FALSE : DISABLE_VALIDATIONS_ATTR_VALUE_3X));
new Document().setRootElement(muleElement);
return ramlElement;
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project mule-migration-assistant by mulesoft.
the class ProtectTagMigrationStepTestCase method getMuleElement.
private Element getMuleElement(boolean isJson) {
Document doc = new Document();
Element element = new Element(MULE_4_TAG_NAME, MULE_4_CORE_NAMESPACE_NO_PREFIX).addContent(new Element(isJson ? JSON_CONFIG : XML_CONFIG, isJson ? JSON_THREAT_PROTECTION_NAMESPACE : XML_THREAT_PROTECTION_NAMESPACE));
doc.setRootElement(element);
return element;
}
Aggregations