ReplicationIT: Replace ExpectedException with assertThrows

The ExpectedException is removed in later branches. Replace it
in stable-2.16 to avoid unnecessary rework when merging up.

Change-Id: I65b18bf77f9d5816e7d2c9533535d0c307f65a46
diff --git a/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationIT.java b/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationIT.java
index 3554700..e97975a 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationIT.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationIT.java
@@ -15,6 +15,7 @@
 package com.googlesource.gerrit.plugins.replication;
 
 import static com.google.common.truth.Truth.assertThat;
+import static com.google.gerrit.testing.GerritJUnit.assertThrows;
 import static java.util.stream.Collectors.toList;
 import static org.easymock.EasyMock.createNiceMock;
 
@@ -251,10 +252,13 @@
     pushResult.getCommit();
     String sourceRef = pushResult.getPatchSet().getRefName();
 
-    exception.expect(InterruptedException.class);
-    try (Repository repo = repoManager.openRepository(targetProject)) {
-      waitUntil(() -> checkedGetRef(repo, sourceRef) != null);
-    }
+    assertThrows(
+        InterruptedException.class,
+        () -> {
+          try (Repository repo = repoManager.openRepository(targetProject)) {
+            waitUntil(() -> checkedGetRef(repo, sourceRef) != null);
+          }
+        });
   }
 
   @Test