use of org.mule.runtime.api.streaming.bytes.CursorStreamProvider in project mule by mulesoft.
the class OperationMessageProcessorTestCase method cursorStreamProvidersAreManaged.
@Test
public void cursorStreamProvidersAreManaged() throws Exception {
CursorStreamProvider provider = mock(CursorStreamProvider.class);
final InputStream inputStream = mock(InputStream.class);
doReturn(provider).when(cursorStreamProviderFactory).of(event, inputStream);
doReturn(provider).when(streamingManager).manage(provider, event);
when(operationExecutor.execute(any())).thenReturn(just(inputStream));
messageProcessor.process(event);
verify(streamingManager).manage(same(provider), any());
}
use of org.mule.runtime.api.streaming.bytes.CursorStreamProvider in project mule by mulesoft.
the class StreamingUtilsTestCase method consumeRepeatableInputStreamPayload.
@Test
@Description("Test that repeatable stream in the payload is consumed into another fully in memory stream provider")
public void consumeRepeatableInputStreamPayload() throws Exception {
CursorStreamProvider payload = asCursorProvider(TEST_PAYLOAD);
CoreEvent event = consumeRepeatablePayload(getEventBuilder().message(Message.of(payload)).build());
assertConsumedRepeatableInputStream(payload, event);
}
Aggregations