use of org.mule.runtime.core.api.streaming.bytes.InMemoryCursorStreamConfig in project mule by mulesoft.
the class CursorStreamProviderTestCase method dataLengthMatchesMaxBufferSizeExactly.
@Test
public void dataLengthMatchesMaxBufferSizeExactly() throws Exception {
data = randomAlphabetic(maxBufferSize);
final ByteArrayInputStream dataStream = new ByteArrayInputStream(data.getBytes());
InMemoryCursorStreamConfig config = new InMemoryCursorStreamConfig(new DataSize(maxBufferSize, BYTE), new DataSize(0, BYTE), new DataSize(maxBufferSize, BYTE));
streamProvider = new InMemoryCursorStreamProvider(dataStream, config, bufferManager);
withCursor(cursor -> assertThat(IOUtils.toString(cursor), equalTo(data)));
}
Aggregations