commit | 54c3c81e58fcb94367988be315db8998baf1610b | [log] [tgz] |
---|---|---|
author | Luca Milanesio <luca.milanesio@gmail.com> | Thu Feb 20 19:27:02 2020 +0000 |
committer | Luca Milanesio <luca.milanesio@gmail.com> | Thu Feb 20 19:27:57 2020 +0000 |
tree | f258df709c12cc7b4e1c7c10e063af62e0816089 | |
parent | e54a99313fd06d37258f16e972afb7c213a5ddd2 [diff] |
Fix compile and test issues on stable-2.16 Gerrit has dropped the support for setting the LogThreshold so remove its use in the multi-site plugin. Also fix the JSON serialisation for strings. Change-Id: Ic2b823ecbcd6044547da4f48ad24e9d27d93aee2
diff --git a/src/main/java/com/googlesource/gerrit/plugins/multisite/forwarder/GsonParser.java b/src/main/java/com/googlesource/gerrit/plugins/multisite/forwarder/GsonParser.java index cd14b93..ddc184a 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/multisite/forwarder/GsonParser.java +++ b/src/main/java/com/googlesource/gerrit/plugins/multisite/forwarder/GsonParser.java
@@ -75,7 +75,11 @@ break; case Constants.PROJECT_LIST: default: - json = gson.toJson(key); + if (key instanceof String) { + json = (String) key; + } else { + json = gson.toJson(key); + } } return json; }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/multisite/kafka/consumer/EventConsumerIT.java b/src/test/java/com/googlesource/gerrit/plugins/multisite/kafka/consumer/EventConsumerIT.java index cbd192d..98c4679 100644 --- a/src/test/java/com/googlesource/gerrit/plugins/multisite/kafka/consumer/EventConsumerIT.java +++ b/src/test/java/com/googlesource/gerrit/plugins/multisite/kafka/consumer/EventConsumerIT.java
@@ -19,7 +19,6 @@ import com.google.gerrit.acceptance.AbstractDaemonTest; import com.google.gerrit.acceptance.GerritConfig; -import com.google.gerrit.acceptance.LogThreshold; import com.google.gerrit.acceptance.NoHttpd; import com.google.gerrit.acceptance.UseLocalDisk; import com.google.gerrit.extensions.api.changes.ReviewInput; @@ -73,7 +72,6 @@ import org.testcontainers.containers.KafkaContainer; @NoHttpd -@LogThreshold(level = "INFO") @UseLocalDisk public class EventConsumerIT extends AbstractDaemonTest { public static final String GERRIT_CONFIG_KEY = "gerrit.installModule";