use of com.mulesoft.tools.migration.library.gateway.steps.policy.http.ErrorResponseBuilderMigrationStep 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());
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.http.ErrorResponseBuilderMigrationStep 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 + "]"));
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.http.ErrorResponseBuilderMigrationStep 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());
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.http.ErrorResponseBuilderMigrationStep 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());
}
use of com.mulesoft.tools.migration.library.gateway.steps.policy.http.ErrorResponseBuilderMigrationStep 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());
}
Aggregations