async def METHOD_NAME(
        protocol, mocker, flow_cls, return_responses, return_class, use_stream
):
    r_val = mocker.Mock()
    with flow_cls(protocol=protocol, asyncio=True).add() as f:
        async for r in f.index(
                from_ndarray(np.random.random([num_docs, 4])),
                on_done=r_val,
                return_responses=return_responses,
                stream=use_stream
        ):
            assert isinstance(r, return_class)
    validate_callback(r_val, validate)