Search in sources :

Example 1 with CursorIterator

use of org.mule.runtime.api.streaming.object.CursorIterator in project mule by mulesoft.

the class DefaultStreamingHelperTestCase method resolveIteratorProvider.

@Test
public void resolveIteratorProvider() {
    CursorIteratorProvider streamProvider = (CursorIteratorProvider) streamingHelper.resolveCursorProvider(valueList.iterator());
    CursorIterator cursor = streamProvider.openCursor();
    valueList.forEach(value -> {
        assertThat(cursor.hasNext(), is(true));
        assertThat(value, equalTo(cursor.next()));
    });
    assertThat(cursor.hasNext(), is(false));
}
Also used : CursorIteratorProvider(org.mule.runtime.api.streaming.object.CursorIteratorProvider) CursorIterator(org.mule.runtime.api.streaming.object.CursorIterator) SmallTest(org.mule.tck.size.SmallTest) Test(org.junit.Test)

Example 2 with CursorIterator

use of org.mule.runtime.api.streaming.object.CursorIterator in project mule by mulesoft.

the class PagedOperationExecutionTestCase method emptyPagedOperation.

@Test
public void emptyPagedOperation() throws Exception {
    CursorIterator iterator = getCursor("emptyPagedOperation");
    assertThat(iterator.hasNext(), is(false));
    assertThat(iterator.getSize(), is(0));
}
Also used : CursorIterator(org.mule.runtime.api.streaming.object.CursorIterator) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 CursorIterator (org.mule.runtime.api.streaming.object.CursorIterator)2 CursorIteratorProvider (org.mule.runtime.api.streaming.object.CursorIteratorProvider)1 SmallTest (org.mule.tck.size.SmallTest)1