Search in sources :

Example 21 with Text

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

the class ErrorResponseBuilderMigrationStepTestCase method errorResponseBuilderElementWithLocation.

@Test
public void errorResponseBuilderElementWithLocation() {
    ErrorResponseBuilderMigrationStep step = new ErrorResponseBuilderMigrationStep();
    step.setApplicationModel(appModel);
    Element element = getTestElement().addContent(getLocationElement());
    step.execute(element, reportMock);
    Text headersText = assertBasicStructure(element);
    assertThat(element.getAttributeValue(STATUS_CODE_ATTR_NAME), is(STATUS_ATTR_VALUE));
    assertLocationHeaders(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 22 with Text

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

the class ErrorResponseBuilderMigrationStepTestCase method simpleErrorResponseBuilderElement.

@Test
public void simpleErrorResponseBuilderElement() {
    ErrorResponseBuilderMigrationStep step = new ErrorResponseBuilderMigrationStep();
    step.setApplicationModel(appModel);
    Element element = getTestElement();
    step.execute(element, reportMock);
    Text headersText = assertBasicStructure(element);
    assertThat(element.getAttributeValue(STATUS_CODE_ATTR_NAME), is(STATUS_ATTR_VALUE));
    assertSimpleContentTypeHeaders(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 23 with Text

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

the class ResponseBuilderMigrationStepTestCase method responseBuilderElementWithCookie.

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

Example 24 with Text

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

the class ResponseBuilderMigrationStepTestCase method responseBuilderWithNoStatus.

@Test
public void responseBuilderWithNoStatus() {
    ResponseBuilderMigrationStep step = new ResponseBuilderMigrationStep();
    step.setApplicationModel(appModel);
    Element element = getTestElement();
    element.removeAttribute(STATUS_ATTR_NAME);
    step.execute(element, reportMock);
    Text headersText = assertBasicStructure(element);
    assertThat(element.getAttributeValue(STATUS_CODE_ATTR_NAME), is(HTTP_LISTENER_RESPONSE_SUCCESS_STATUS_CODE));
    assertNoStatusHeaders(headersText.getText());
}
Also used : ResponseBuilderMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.http.ResponseBuilderMigrationStep) Element(org.jdom2.Element) Text(org.jdom2.Text) Test(org.junit.Test)

Example 25 with Text

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

the class ResponseBuilderMigrationStepTestCase method responseBuilderElementWithHeader.

@Test
public void responseBuilderElementWithHeader() {
    ResponseBuilderMigrationStep step = new ResponseBuilderMigrationStep();
    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 : ResponseBuilderMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.http.ResponseBuilderMigrationStep) Element(org.jdom2.Element) 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