use of io.rx_cache2.Reply in project RxCache by VictorAlbertos.
the class ProvidersDynamicsKeysRxCacheTest method Pagination_With_Evict_Cache_By_Page.
@Test
public void Pagination_With_Evict_Cache_By_Page() {
TestObserver<Reply<List<io.rx_cache2.internal.Mock>>> observer;
observer = providersRxCache.getMocksDynamicKeyEvictPage(Observable.just(createMocks(SIZE)), new DynamicKey(1), new EvictDynamicKey(true)).test();
observer.awaitTerminalEvent();
observer = providersRxCache.getMocksDynamicKeyEvictPage(Observable.just(createMocks(SIZE)), new DynamicKey(2), new EvictDynamicKey(true)).test();
observer.awaitTerminalEvent();
observer = providersRxCache.getMocksDynamicKeyEvictPage(ProviderHelper.<List<io.rx_cache2.internal.Mock>>withoutLoader(), new DynamicKey(1), new EvictDynamicKey(true)).test();
observer.awaitTerminalEvent();
assertThat(observer.errors().size(), is(1));
assertThat(observer.values().size(), is(0));
observer = providersRxCache.getMocksDynamicKeyEvictPage(ProviderHelper.<List<io.rx_cache2.internal.Mock>>withoutLoader(), new DynamicKey(2), new EvictDynamicKey(false)).test();
observer.awaitTerminalEvent();
assertThat(observer.errors().size(), is(0));
assertThat(observer.values().size(), is(1));
}
Aggregations