Adapt the test code to not mock cache instances

Recent Bazel upgrades Error Prone major version to 2.4.0, that is much
stricter now. Particularly DoNotMock pattern doesn't allow to Mock cache
instances any more:

  RateLimitUploadListenerTest.java:44: error: [DoNotMock] Do not mock
  'com.google.common.cache.LoadingCache<java.lang.String,com.googlesource.gerrit.plugins.quota.Module.Holder>'
  (which is-a 'com.google.common.cache.Cache'); com.google.common.cache.Cache is annotated as @DoNotMock:
  Use CacheBuilder.newBuilder().build().
  @Mock private LoadingCache<String, Holder> limitsPerRemoteHost;
                                             ^
    (see https://errorprone.info/bugpattern/DoNotMock)

Adapt the code to not mock the cache instance.

One side effect of this change, is that testDoFilterCacheMiss test is
removed.

The ExecutionException is thrown when a cache loader throws a (runtime)
exception while loading a value (which wasn't present in the cache). The
thrown ExecutionException wraps the root cause exception. However, the
reason for testing this behavior here is not clear. Further, it is also
not clear why should in the case of ExecutionException all requests be
rejected as if the rate limit was exceeded.

Change-Id: Ieb1327ed71df2f72bcd7243fae9821168dc07238
(cherry picked from commit dbe485d16d3193b5f40fb46e5a89b918b3292630)
2 files changed