use of com.mulesoft.tools.migration.library.gateway.steps.policy.http.ResponseBuilderMigrationStep 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());
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.http.ResponseBuilderMigrationStep 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());
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.http.ResponseBuilderMigrationStep 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());
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.http.ResponseBuilderMigrationStep in project mule-migration-assistant by mulesoft.
the class ResponseBuilderMigrationStepTestCase method responseBuilderRaw.
@Test
public void responseBuilderRaw() {
ResponseBuilderMigrationStep step = new ResponseBuilderMigrationStep();
step.setApplicationModel(appModel);
Element element = new Element(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_SUCCESS_STATUS_CODE));
assertThat(headersText.getText(), is(HEADERS_CONTENT_VALUE + "]"));
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.http.ResponseBuilderMigrationStep in project mule-migration-assistant by mulesoft.
the class ResponseBuilderMigrationStepTestCase method responseBuilderElementWithExpires.
@Test
public void responseBuilderElementWithExpires() {
ResponseBuilderMigrationStep step = new ResponseBuilderMigrationStep();
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());
}
Aggregations