use of cyclops.futurestream.SimpleReact in project cyclops by aol.
the class ReactPoolTest method testRoundRobin.
@Test
public void testRoundRobin() {
SimpleReact react1 = Mockito.mock(SimpleReact.class);
SimpleReact react2 = Mockito.mock(SimpleReact.class);
ReactPool<SimpleReact> pool = ReactPool.boundedPool(asList(react1, react2));
List<Supplier<String>> suppliers = Arrays.asList(() -> "hello", () -> "world");
pool.react((er) -> er.fromIterableAsync(suppliers));
pool.react((er) -> er.fromIterableAsync(suppliers));
Mockito.verify(react1, Mockito.times(1)).fromIterableAsync(suppliers);
Mockito.verify(react2, Mockito.times(1)).fromIterableAsync(suppliers);
}
Aggregations