Search in sources :

Example 16 with Text

use of org.geotoolkit.swe.xml.v101.Text in project mule-migration-assistant by mulesoft.

the class ErrorResponseBuilderMigrationStepTestCase method errorResponseBuilderFull.

@Test
public void errorResponseBuilderFull() {
    ErrorResponseBuilderMigrationStep step = new ErrorResponseBuilderMigrationStep();
    step.setApplicationModel(appModel);
    Element element = getTestElement().addContent(getHeadersElement()).addContent(getFullSetCookieElement()).addContent(getCacheControlElement()).addContent(getExpiresElement()).addContent(getLocationElement());
    step.execute(element, reportMock);
    Text headersText = assertBasicStructure(element);
    assertThat(element.getAttributeValue(STATUS_CODE_ATTR_NAME), is(STATUS_ATTR_VALUE));
    assertFullResponseHeaders(headersText.getText());
}
Also used : Element(org.jdom2.Element) ErrorResponseBuilderMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.http.ErrorResponseBuilderMigrationStep) Text(org.jdom2.Text) Test(org.junit.Test)

Example 17 with Text

use of org.geotoolkit.swe.xml.v101.Text in project mule-migration-assistant by mulesoft.

the class ErrorResponseBuilderMigrationStepTestCase method errorResponseBuilderRaw.

@Test
public void errorResponseBuilderRaw() {
    ErrorResponseBuilderMigrationStep step = new ErrorResponseBuilderMigrationStep();
    step.setApplicationModel(appModel);
    Element element = new Element(ERROR_RESPONSE_BUILDER_TAG_NAME, HTTP_NAMESPACE);
    step.execute(element, reportMock);
    Text headersText = assertBasicStructure(element);
    assertThat(element.getAttributeValue(STATUS_CODE_ATTR_NAME), is(HTTP_LISTENER_RESPONSE_ERROR_STATUS_CODE));
    assertThat(headersText.getText(), is(HEADERS_CONTENT_VALUE + "]"));
}
Also used : Element(org.jdom2.Element) ErrorResponseBuilderMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.http.ErrorResponseBuilderMigrationStep) Text(org.jdom2.Text) Test(org.junit.Test)

Example 18 with Text

use of org.geotoolkit.swe.xml.v101.Text in project mule-migration-assistant by mulesoft.

the class ErrorResponseBuilderMigrationStepTestCase method errorResponseBuilderElementWithCacheControl.

@Test
public void errorResponseBuilderElementWithCacheControl() {
    ErrorResponseBuilderMigrationStep step = new ErrorResponseBuilderMigrationStep();
    step.setApplicationModel(appModel);
    Element element = getTestElement().addContent(getCacheControlElement());
    step.execute(element, reportMock);
    Text headersText = assertBasicStructure(element);
    assertThat(element.getAttributeValue(STATUS_CODE_ATTR_NAME), is(STATUS_ATTR_VALUE));
    assertCacheControlHeaders(headersText.getText());
}
Also used : Element(org.jdom2.Element) ErrorResponseBuilderMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.http.ErrorResponseBuilderMigrationStep) Text(org.jdom2.Text) Test(org.junit.Test)

Example 19 with Text

use of org.geotoolkit.swe.xml.v101.Text in project mule-migration-assistant by mulesoft.

the class ErrorResponseBuilderMigrationStepTestCase method errorResponseBuilderElementWithHeader.

@Test
public void errorResponseBuilderElementWithHeader() {
    ErrorResponseBuilderMigrationStep step = new ErrorResponseBuilderMigrationStep();
    step.setApplicationModel(appModel);
    Element element = getTestElement().addContent(getHeadersElement());
    step.execute(element, reportMock);
    Text headersText = assertBasicStructure(element);
    assertThat(element.getAttributeValue(STATUS_CODE_ATTR_NAME), is(STATUS_ATTR_VALUE));
    assertSimpleHeaders(headersText.getText());
}
Also used : Element(org.jdom2.Element) ErrorResponseBuilderMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.http.ErrorResponseBuilderMigrationStep) Text(org.jdom2.Text) Test(org.junit.Test)

Example 20 with Text

use of org.geotoolkit.swe.xml.v101.Text in project mule-migration-assistant by mulesoft.

the class ErrorResponseBuilderMigrationStepTestCase method errorResponseBuilderElementWithExpires.

@Test
public void errorResponseBuilderElementWithExpires() {
    ErrorResponseBuilderMigrationStep step = new ErrorResponseBuilderMigrationStep();
    step.setApplicationModel(appModel);
    Element element = getTestElement().addContent(getExpiresElement());
    step.execute(element, reportMock);
    Text headersText = assertBasicStructure(element);
    assertThat(element.getAttributeValue(STATUS_CODE_ATTR_NAME), is(STATUS_ATTR_VALUE));
    assertExpiresHeaders(headersText.getText());
}
Also used : Element(org.jdom2.Element) ErrorResponseBuilderMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.http.ErrorResponseBuilderMigrationStep) Text(org.jdom2.Text) Test(org.junit.Test)

Aggregations

Text (org.jdom2.Text)70 Element (org.jdom2.Element)57 Test (org.junit.Test)27 ErrorResponseBuilderMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.http.ErrorResponseBuilderMigrationStep)11 ResponseBuilderMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.http.ResponseBuilderMigrationStep)11 Content (org.jdom2.Content)7 ArrayList (java.util.ArrayList)5 Document (org.jdom2.Document)5 StringWriter (java.io.StringWriter)4 BeforeEach (org.junit.jupiter.api.BeforeEach)4 URL (java.net.URL)3 Map (java.util.Map)3 AnyScalarPropertyType (org.geotoolkit.swe.xml.v101.AnyScalarPropertyType)3 DataArrayType (org.geotoolkit.swe.xml.v101.DataArrayType)3 XMLOutputter (org.jdom2.output.XMLOutputter)3 BaseText (com.adobe.cq.wcm.core.components.it.seljup.util.components.text.BaseText)2 Text (com.adobe.cq.wcm.core.components.it.seljup.util.components.text.v1.Text)2 Text (com.adobe.cq.wcm.core.components.it.seljup.util.components.text.v2.Text)2 IString (io.usethesource.vallang.IString)2 IOException (java.io.IOException)2