@Test public void put_writeErrors_notifiesError() { when(storageClient.write(fetchEligibleCampaignsResponse2)) .thenReturn(Completable.error(new IOException())); TestSubscriber<Object> subscriber = campaignCacheClient.put(fetchEligibleCampaignsResponse2).toFlowable().test(); subscriber.assertError(IOException.class); }
public Completable put(FetchEligibleCampaignsResponse fetchEligibleCampaignsResponse) { return storageClient .write(fetchEligibleCampaignsResponse) .doOnComplete(() -> cachedResponse = fetchEligibleCampaignsResponse); }
CampaignCacheClient { public Completable put(FetchEligibleCampaignsResponse fetchEligibleCampaignsResponse) { return storageClient .write(fetchEligibleCampaignsResponse) .doOnComplete(() -> cachedResponse = fetchEligibleCampaignsResponse); } }
CampaignCacheClient { public Completable put(FetchEligibleCampaignsResponse fetchEligibleCampaignsResponse) { return storageClient .write(fetchEligibleCampaignsResponse) .doOnComplete(() -> cachedResponse = fetchEligibleCampaignsResponse); } @Inject  CampaignCacheClient(
      @CampaignCache ProtoStorageClient storageClient, Application application, Clock clock); }
CampaignCacheClient { public Completable put(FetchEligibleCampaignsResponse fetchEligibleCampaignsResponse) { return storageClient .write(fetchEligibleCampaignsResponse) .doOnComplete(() -> cachedResponse = fetchEligibleCampaignsResponse); } @Inject  CampaignCacheClient(
      @CampaignCache ProtoStorageClient storageClient, Application application, Clock clock); Completable put(FetchEligibleCampaignsResponse fetchEligibleCampaignsResponse); Maybe<FetchEligibleCampaignsResponse> get(); }
CampaignCacheClient { public Completable put(FetchEligibleCampaignsResponse fetchEligibleCampaignsResponse) { return storageClient .write(fetchEligibleCampaignsResponse) .doOnComplete(() -> cachedResponse = fetchEligibleCampaignsResponse); } @Inject  CampaignCacheClient(
      @CampaignCache ProtoStorageClient storageClient, Application application, Clock clock); Completable put(FetchEligibleCampaignsResponse fetchEligibleCampaignsResponse); Maybe<FetchEligibleCampaignsResponse> get();  }