Merge branch 'stable-3.3'
* stable-3.3:
Initial implementation
Change-Id: I1696933a2c1a870ba71eb6835e0fa281d0581eb2
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replicationstatus/EventHandler.java b/src/main/java/com/googlesource/gerrit/plugins/replicationstatus/EventHandler.java
index 580a85a..b197d7f 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replicationstatus/EventHandler.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replicationstatus/EventHandler.java
@@ -24,7 +24,7 @@
import com.google.gerrit.server.events.EventListener;
import com.google.inject.Inject;
import com.google.inject.name.Named;
-import com.googlesource.gerrit.plugins.replication.RefReplicatedEvent;
+import com.googlesource.gerrit.plugins.replication.events.RefReplicatedEvent;
class EventHandler implements EventListener {
private final Cache<ReplicationStatus.Key, ReplicationStatus> replicationStatusCache;
@@ -47,7 +47,7 @@
ReplicationStatus.Key cacheKey =
ReplicationStatus.Key.create(
- Project.nameKey(replEvent.project), replEvent.targetNode, replEvent.ref);
+ Project.nameKey(replEvent.project), replEvent.targetUri, replEvent.ref);
replicationStatusCache.put(
cacheKey,
diff --git a/src/test/java/com/googlesource/gerrit/plugins/replicationstatus/ReplicationStatusIT.java b/src/test/java/com/googlesource/gerrit/plugins/replicationstatus/ReplicationStatusIT.java
index 493fdbd..68508f3 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/replicationstatus/ReplicationStatusIT.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/replicationstatus/ReplicationStatusIT.java
@@ -37,12 +37,13 @@
import com.google.gerrit.server.config.SitePaths;
import com.google.gson.Gson;
import com.google.inject.Inject;
-import com.googlesource.gerrit.plugins.replication.RefReplicatedEvent;
+import com.googlesource.gerrit.plugins.replication.events.RefReplicatedEvent;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Collections;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.transport.RemoteRefUpdate;
+import org.eclipse.jgit.transport.URIish;
import org.junit.Before;
import org.junit.Test;
@@ -203,9 +204,10 @@
String ref,
String remote,
RefPushResult status,
- RemoteRefUpdate.Status refStatus) {
+ RemoteRefUpdate.Status refStatus)
+ throws URISyntaxException {
RefReplicatedEvent replicatedEvent =
- new RefReplicatedEvent(project.get(), ref, remote, status, refStatus);
+ new RefReplicatedEvent(project.get(), ref, new URIish(remote), status, refStatus);
replicatedEvent.instanceId = instanceId;
replicatedEvent.eventCreatedOn = when;
@@ -213,7 +215,7 @@
}
private RefReplicatedEvent successReplicatedEvent(
- @Nullable String instanceId, long when, String remoteUrl) {
+ @Nullable String instanceId, long when, String remoteUrl) throws URISyntaxException {
return replicatedEvent(
instanceId,
@@ -225,7 +227,7 @@
}
private RefReplicatedEvent failedReplicatedEvent(
- @Nullable String instanceId, long when, String remoteUrl) {
+ @Nullable String instanceId, long when, String remoteUrl) throws URISyntaxException {
return replicatedEvent(
instanceId,