use of org.mule.runtime.core.api.event.CoreEvent in project mule by mulesoft.
the class OperationExecutionTestCase method optionalParameterWithDefaultOverride.
@Test
public void optionalParameterWithDefaultOverride() throws Exception {
CoreEvent event = flowRunner("customKillWithoutDefault").withPayload(EMPTY_STRING).withVariable("goodbye", GOODBYE_MESSAGE).withVariable("victim", VICTIM).run();
assertKillPayload(event);
}
use of org.mule.runtime.core.api.event.CoreEvent in project mule by mulesoft.
the class ContentTypeHandlingTestCase method setEncodingInMimeTypeAndParam.
@Test
public void setEncodingInMimeTypeAndParam() throws Exception {
CoreEvent response = runFlow("setEncodingInMimeTypeAndParam");
DataType dataType = response.getMessage().getPayload().getDataType();
assertThat(dataType.getMediaType().getPrimaryType(), is("application"));
assertThat(dataType.getMediaType().getSubType(), is("json"));
assertThat(dataType.getMediaType().getCharset().get(), is(StandardCharsets.UTF_16));
}
use of org.mule.runtime.core.api.event.CoreEvent in project mule by mulesoft.
the class ContentTypeHandlingTestCase method overridesContentType.
@Test
public void overridesContentType() throws Exception {
Charset lastSupportedEncoding = availableCharsets().values().stream().reduce((first, last) -> last).get();
CoreEvent response = runFlow("setsContentTypeProgrammatically");
final DataType dataType = response.getMessage().getPayload().getDataType();
assertCustomMimeType(dataType);
assertThat(dataType.getMediaType().getCharset().get(), is(lastSupportedEncoding));
}
use of org.mule.runtime.core.api.event.CoreEvent in project mule by mulesoft.
the class ContentTypeHandlingTestCase method strictMimeType.
@Test
public void strictMimeType() throws Exception {
CoreEvent response = runFlow("strictMimeType");
assertThat(response.getMessage().getPayload().getDataType().getMediaType().matches(TEXT), is(true));
}
use of org.mule.runtime.core.api.event.CoreEvent in project mule by mulesoft.
the class ContentTypeHandlingTestCase method onlySetEncodingOnXml.
@Test
public void onlySetEncodingOnXml() throws Exception {
CoreEvent response = runFlow("onlySetEncodingOnXml");
DataType dataType = response.getMessage().getPayload().getDataType();
assertCustomEncoding(dataType);
}
Aggregations