QueueManager { public Flowable<Pair<List<Track>, Integer>> queue() { return queueRelay.toFlowable(BackpressureStrategy.LATEST); } QueueManager(Random random); Flowable<Pair<Integer, Integer>> mode(); Flowable<Pair<List<Track>, Integer>> queue(); void setQueue(List<Track> queue, long queueItemId); Track currentTrack(); static final int SHUFFLE_OFF; static final int SHUFFLE_ALL; static final int REPEAT_OFF; static final int REPEAT_ALL; static final int REPEAT_ONE; }
@Test public void currentQueue() { TestSubscriber<Pair<List<Track>, Integer>> test = queueManager.queue().take(1).test(); test.awaitTerminalEvent(); List<Track> actualQueue = test.values().get(0).first; int actualPosition = test.values().get(0).second; assertThat(actualQueue, IsIterableContainingInOrder.contains( queue.get(0), queue.get(1), queue.get(2), queue.get(3), queue.get(4))); assertThat(actualPosition, is(0)); }