@Test public void testGetStoriesNoListener() { client.getStories("filter", ItemManager.MODE_DEFAULT, null); verify(TestRestServiceFactory.algoliaRestService, never()).searchByDateRx(eq("filter")); }
@Override public void getStories(String filter, @CacheMode int cacheMode, final ResponseListener<Item[]> listener) { if (listener == null) { return; } searchRx(filter) .map(this::toItems) .observeOn(mMainThreadScheduler) .subscribe(listener::onResponse, t -> listener.onError(t != null ? t.getMessage() : "")); }
AlgoliaClient implements ItemManager { @Override public void getStories(String filter, @CacheMode int cacheMode, final ResponseListener<Item[]> listener) { if (listener == null) { return; } searchRx(filter) .map(this::toItems) .observeOn(mMainThreadScheduler) .subscribe(listener::onResponse, t -> listener.onError(t != null ? t.getMessage() : "")); } }
AlgoliaClient implements ItemManager { @Override public void getStories(String filter, @CacheMode int cacheMode, final ResponseListener<Item[]> listener) { if (listener == null) { return; } searchRx(filter) .map(this::toItems) .observeOn(mMainThreadScheduler) .subscribe(listener::onResponse, t -> listener.onError(t != null ? t.getMessage() : "")); } @Inject  AlgoliaClient(RestServiceFactory factory); }
AlgoliaClient implements ItemManager { @Override public void getStories(String filter, @CacheMode int cacheMode, final ResponseListener<Item[]> listener) { if (listener == null) { return; } searchRx(filter) .map(this::toItems) .observeOn(mMainThreadScheduler) .subscribe(listener::onResponse, t -> listener.onError(t != null ? t.getMessage() : "")); } @Inject  AlgoliaClient(RestServiceFactory factory); @Override void getStories(String filter, @CacheMode int cacheMode,
                           final ResponseListener<Item[]> listener); @Override void getItem(String itemId, @CacheMode int cacheMode, ResponseListener<Item> listener); @Override Item[] getStories(String filter, @CacheMode int cacheMode); @Override Item getItem(String itemId, @CacheMode int cacheMode); }
AlgoliaClient implements ItemManager { @Override public void getStories(String filter, @CacheMode int cacheMode, final ResponseListener<Item[]> listener) { if (listener == null) { return; } searchRx(filter) .map(this::toItems) .observeOn(mMainThreadScheduler) .subscribe(listener::onResponse, t -> listener.onError(t != null ? t.getMessage() : "")); } @Inject  AlgoliaClient(RestServiceFactory factory); @Override void getStories(String filter, @CacheMode int cacheMode,
                           final ResponseListener<Item[]> listener); @Override void getItem(String itemId, @CacheMode int cacheMode, ResponseListener<Item> listener); @Override Item[] getStories(String filter, @CacheMode int cacheMode); @Override Item getItem(String itemId, @CacheMode int cacheMode); static boolean sSortByTime; static final String HOST; }