Fix getIfPresentObjectNonStringTest
Running the `getIfPresentObjectNonStringTest` with a newer bazel version
(0.22.0) failed due to an error-prone check:
error: [IncompatibleArgumentType] Argument 'path' should not be
passed to this method. Its type Path is not compatible with the
required type: String.
assertThat(flatFileWebSessionCache.getIfPresent(path)).isNull();
^
(see https://errorprone.info/bugpattern/IncompatibleArgumentType)
The updated code of the websession cache used in the HA-plugin already
used an empty Object() instead of a Path-object. This change adapts this
change to this plugin, which fixes the failing test.
Change-Id: I2f383b13a0cb5c421e4326eaac872daf1b0849ef
diff --git a/src/test/java/com/googlesource/gerrit/plugins/websession/flatfile/FlatFileWebSessionCacheTest.java b/src/test/java/com/googlesource/gerrit/plugins/websession/flatfile/FlatFileWebSessionCacheTest.java index 038135a..905d6bf 100644 --- a/src/test/java/com/googlesource/gerrit/plugins/websession/flatfile/FlatFileWebSessionCacheTest.java +++ b/src/test/java/com/googlesource/gerrit/plugins/websession/flatfile/FlatFileWebSessionCacheTest.java
@@ -106,8 +106,7 @@ @Test public void getIfPresentObjectNonStringTest() throws Exception { - Path path = dir.resolve(key); - assertThat(flatFileWebSessionCache.getIfPresent(path)).isNull(); + assertThat(flatFileWebSessionCache.getIfPresent(new Object())).isNull(); } @Test