@Test public void increment_noExistingCounter_writesToStorage() { when(storageClient.read(any(RateLimitParser.class))).thenReturn(Maybe.empty()); rateLimiterClient.increment(rateLimit).subscribe(); assertThat(wasWritten).isTrue(); }
private static Counter increment(Counter current) { return Counter.newBuilder(current).clearValue().setValue(current.getValue() + 1).build(); }
RateLimiterClient { private static Counter increment(Counter current) { return Counter.newBuilder(current).clearValue().setValue(current.getValue() + 1).build(); } }
RateLimiterClient { private static Counter increment(Counter current) { return Counter.newBuilder(current).clearValue().setValue(current.getValue() + 1).build(); } @Inject  RateLimiterClient(
      @com.google.firebase.inappmessaging.internal.injection.qualifiers.RateLimit
          ProtoStorageClient storageClient,
      Clock clock); }
RateLimiterClient { private static Counter increment(Counter current) { return Counter.newBuilder(current).clearValue().setValue(current.getValue() + 1).build(); } @Inject  RateLimiterClient(
      @com.google.firebase.inappmessaging.internal.injection.qualifiers.RateLimit
          ProtoStorageClient storageClient,
      Clock clock); Completable increment(RateLimit limit); Single<Boolean> isRateLimited(RateLimit limit); }
RateLimiterClient { private static Counter increment(Counter current) { return Counter.newBuilder(current).clearValue().setValue(current.getValue() + 1).build(); } @Inject  RateLimiterClient(
      @com.google.firebase.inappmessaging.internal.injection.qualifiers.RateLimit
          ProtoStorageClient storageClient,
      Clock clock); Completable increment(RateLimit limit); Single<Boolean> isRateLimited(RateLimit limit);  }