summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Hiesel <hiesel@google.com>2017-08-07 11:24:04 +0200
committerPatrick Hiesel <hiesel@google.com>2017-08-07 15:49:44 +0200
commit0721b208ad863ff2f2c7fe1c89950dc2b921abaa (patch)
tree76b38cf8dfe8eb89d767691164b9f759aeacc3d6
parentfae5360380023e8351f39be3d4effd4bb2cd8906 (diff)
Migrate calls to ChangeControl#isVisible to PermissionBackend
-rw-r--r--src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java3
-rw-r--r--src/test/java/com/googlesource/gerrit/plugins/replication/GitUpdateProcessingTest.java9
2 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java b/src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java
index 951ae9c..654cd1f 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java
@@ -16,6 +16,7 @@ package com.googlesource.gerrit.plugins.replication;
import com.google.gerrit.common.EventDispatcher;
import com.google.gerrit.server.events.RefEvent;
+import com.google.gerrit.server.permissions.PermissionBackendException;
import com.google.gwtorm.server.OrmException;
import com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult;
import java.lang.ref.WeakReference;
@@ -187,7 +188,7 @@ public abstract class PushResultProcessing {
private void postEvent(RefEvent event) {
try {
dispatcher.postEvent(event);
- } catch (OrmException e) {
+ } catch (OrmException | PermissionBackendException e) {
log.error("Cannot post event", e);
}
}
diff --git a/src/test/java/com/googlesource/gerrit/plugins/replication/GitUpdateProcessingTest.java b/src/test/java/com/googlesource/gerrit/plugins/replication/GitUpdateProcessingTest.java
index 41829bc..337bd1d 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/replication/GitUpdateProcessingTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/replication/GitUpdateProcessingTest.java
@@ -24,6 +24,7 @@ import static org.easymock.EasyMock.verify;
import com.google.gerrit.common.EventDispatcher;
import com.google.gerrit.reviewdb.server.ReviewDb;
+import com.google.gerrit.server.permissions.PermissionBackendException;
import com.google.gwtorm.client.KeyUtil;
import com.google.gwtorm.server.OrmException;
import com.google.gwtorm.server.SchemaFactory;
@@ -58,7 +59,8 @@ public class GitUpdateProcessingTest {
}
@Test
- public void headRefReplicated() throws URISyntaxException, OrmException {
+ public void headRefReplicated()
+ throws URISyntaxException, OrmException, PermissionBackendException {
reset(dispatcherMock);
RefReplicatedEvent expectedEvent =
new RefReplicatedEvent(
@@ -81,7 +83,8 @@ public class GitUpdateProcessingTest {
}
@Test
- public void changeRefReplicated() throws URISyntaxException, OrmException {
+ public void changeRefReplicated()
+ throws URISyntaxException, OrmException, PermissionBackendException {
reset(dispatcherMock);
RefReplicatedEvent expectedEvent =
new RefReplicatedEvent(
@@ -104,7 +107,7 @@ public class GitUpdateProcessingTest {
}
@Test
- public void onAllNodesReplicated() throws OrmException {
+ public void onAllNodesReplicated() throws OrmException, PermissionBackendException {
reset(dispatcherMock);
RefReplicationDoneEvent expectedDoneEvent =
new RefReplicationDoneEvent("someProject", "refs/heads/master", 5);