@Test public void getAllImpressions_noErrors_returnsCampaignsList() { TestSubscriber<CampaignImpressionList> subscriber = impressionStorageClient.getAllImpressions().toFlowable().test(); assertThat(getPlainValues(subscriber)).containsExactly(campaignImpressionList); }
public Maybe<CampaignImpressionList> getAllImpressions() { return cachedImpressionsMaybe .switchIfEmpty( storageClient.read(CampaignImpressionList.parser()).doOnSuccess(this::initInMemCache)) .doOnError(ignored -> clearInMemCache()); }
ImpressionStorageClient { public Maybe<CampaignImpressionList> getAllImpressions() { return cachedImpressionsMaybe .switchIfEmpty( storageClient.read(CampaignImpressionList.parser()).doOnSuccess(this::initInMemCache)) .doOnError(ignored -> clearInMemCache()); } }
ImpressionStorageClient { public Maybe<CampaignImpressionList> getAllImpressions() { return cachedImpressionsMaybe .switchIfEmpty( storageClient.read(CampaignImpressionList.parser()).doOnSuccess(this::initInMemCache)) .doOnError(ignored -> clearInMemCache()); } @Inject  ImpressionStorageClient(@ImpressionStore ProtoStorageClient storageClient); }
ImpressionStorageClient { public Maybe<CampaignImpressionList> getAllImpressions() { return cachedImpressionsMaybe .switchIfEmpty( storageClient.read(CampaignImpressionList.parser()).doOnSuccess(this::initInMemCache)) .doOnError(ignored -> clearInMemCache()); } @Inject  ImpressionStorageClient(@ImpressionStore ProtoStorageClient storageClient); Completable storeImpression(CampaignImpression impression); Maybe<CampaignImpressionList> getAllImpressions(); Single<Boolean> isImpressed(CampaignProto.ThickContent content); Completable clearImpressions(FetchEligibleCampaignsResponse response); }
ImpressionStorageClient { public Maybe<CampaignImpressionList> getAllImpressions() { return cachedImpressionsMaybe .switchIfEmpty( storageClient.read(CampaignImpressionList.parser()).doOnSuccess(this::initInMemCache)) .doOnError(ignored -> clearInMemCache()); } @Inject  ImpressionStorageClient(@ImpressionStore ProtoStorageClient storageClient); Completable storeImpression(CampaignImpression impression); Maybe<CampaignImpressionList> getAllImpressions(); Single<Boolean> isImpressed(CampaignProto.ThickContent content); Completable clearImpressions(FetchEligibleCampaignsResponse response);  }