commit | 53ff0d34ce7a4a2f390c3f4f5b413d0dbd5389d2 | [log] [tgz] |
---|---|---|
author | Thomas Draebing <thomas.draebing@sap.com> | Mon Apr 15 09:30:48 2019 +0200 |
committer | Thomas Draebing <thomas.draebing@sap.com> | Thu Apr 18 10:32:47 2019 +0200 |
tree | 048386fe3d949bcb923ee18a31eeb1b2eb4e3fb4 | |
parent | 0d01796298bb2725769bd5469aa3b7931ee9dfe1 [diff] |
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