diff --git a/BUILD b/BUILD
index 2885dda..3ebfd66 100644
--- a/BUILD
+++ b/BUILD
@@ -14,7 +14,6 @@
 ]
 
 EXECUTOR_DEPS = CONDUCTOR_DEPS + [
-    "@jgit//jar",
     "@javaewah//jar",
     "@guava//jar",
     "@guava-failureaccess//jar",
@@ -28,6 +27,7 @@
     "@log4j-api//jar",
     "@log4j-core//jar",
     "@retry//jar",
+    "//lib:jgit",
 ]
 
 gerrit_plugin(
diff --git a/WORKSPACE b/WORKSPACE
index f4bf5e4..770609a 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -3,7 +3,7 @@
 load("//:bazlets.bzl", "load_bazlets")
 
 load_bazlets(
-    commit = "96f691ebbf4ef1c46b798e871ed5acd9d844651c",
+    commit = "f30a992da9fc855dce819875afb59f9dd6f860cd",
     #local_path = "/home/<user>/projects/bazlets",
 )
 
diff --git a/external_plugin_deps.bzl b/external_plugin_deps.bzl
index 4cf2cb3..2eb57e7 100644
--- a/external_plugin_deps.bzl
+++ b/external_plugin_deps.bzl
@@ -100,8 +100,8 @@
     maven_jar(
         name = "jgit",
         artifact =
-            "org.eclipse.jgit:org.eclipse.jgit:5.3.6.201910020505-r",
-        sha1 = "0b9085bd16c630412bfa50bcc509dcedfbbe16d3",
+            "org.eclipse.jgit:org.eclipse.jgit:5.5.1.201910021850-r",
+        sha1 = "e0ba7a468e8c62da8521ca3a06a061d4dde95223",
     )
 
     maven_jar(
diff --git a/lib/BUILD b/lib/BUILD
new file mode 100644
index 0000000..dd99fbc
--- /dev/null
+++ b/lib/BUILD
@@ -0,0 +1,7 @@
+load("@rules_java//java:defs.bzl", "java_library")
+
+java_library(
+    name = "jgit",
+    visibility = ["//visibility:public"],
+    exports = ["@jgit//jar"],
+)
diff --git a/src/main/java/com/ericsson/gerrit/plugins/gcconductor/command/AddToQueue.java b/src/main/java/com/ericsson/gerrit/plugins/gcconductor/command/AddToQueue.java
index d9fe107..25939a2 100644
--- a/src/main/java/com/ericsson/gerrit/plugins/gcconductor/command/AddToQueue.java
+++ b/src/main/java/com/ericsson/gerrit/plugins/gcconductor/command/AddToQueue.java
@@ -20,8 +20,8 @@
 import com.ericsson.gerrit.plugins.gcconductor.GcQueueException;
 import com.ericsson.gerrit.plugins.gcconductor.Hostname;
 import com.google.gerrit.common.data.GlobalCapability;
+import com.google.gerrit.entities.Project;
 import com.google.gerrit.extensions.annotations.RequiresCapability;
-import com.google.gerrit.reviewdb.client.Project;
 import com.google.gerrit.server.git.GitRepositoryManager;
 import com.google.gerrit.server.git.LocalDiskRepositoryManager;
 import com.google.gerrit.server.project.ProjectCache;
@@ -85,7 +85,7 @@
       throw die("Unable to resolve path to " + repository);
     }
     String projectName = extractFrom(repository);
-    Project.NameKey nameKey = new Project.NameKey(projectName);
+    Project.NameKey nameKey = Project.nameKey(projectName);
     if (projectCache.get(nameKey) == null) {
       throw die(String.format("Repository %s not found", repository));
     }
diff --git a/src/main/java/com/ericsson/gerrit/plugins/gcconductor/evaluator/Evaluator.java b/src/main/java/com/ericsson/gerrit/plugins/gcconductor/evaluator/Evaluator.java
index 5ae7fac..037d11d 100644
--- a/src/main/java/com/ericsson/gerrit/plugins/gcconductor/evaluator/Evaluator.java
+++ b/src/main/java/com/ericsson/gerrit/plugins/gcconductor/evaluator/Evaluator.java
@@ -18,8 +18,8 @@
 import com.google.common.util.concurrent.JdkFutureAdapters;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
+import com.google.gerrit.entities.Project;
 import com.google.gerrit.extensions.events.GitReferenceUpdatedListener;
-import com.google.gerrit.reviewdb.client.Project;
 import com.google.gerrit.server.config.GerritServerConfig;
 import com.google.gerrit.server.git.GitRepositoryManager;
 import com.google.gerrit.server.git.validators.UploadValidationListener;
@@ -109,7 +109,7 @@
   @Override
   public void onGitReferenceUpdated(Event event) {
     String projectName = event.getProjectName();
-    Project.NameKey projectNameKey = new Project.NameKey(projectName);
+    Project.NameKey projectNameKey = Project.nameKey(projectName);
     try (Repository repository = repoManager.openRepository(projectNameKey)) {
       String repositoryPath = repository.getDirectory().getAbsolutePath();
       queueEvaluationIfNecessary(repositoryPath);
diff --git a/src/test/java/com/ericsson/gerrit/plugins/gcconductor/evaluator/EvaluatorTest.java b/src/test/java/com/ericsson/gerrit/plugins/gcconductor/evaluator/EvaluatorTest.java
index 7dc403b..b503259 100644
--- a/src/test/java/com/ericsson/gerrit/plugins/gcconductor/evaluator/EvaluatorTest.java
+++ b/src/test/java/com/ericsson/gerrit/plugins/gcconductor/evaluator/EvaluatorTest.java
@@ -23,8 +23,8 @@
 
 import com.ericsson.gerrit.plugins.gcconductor.EvaluationTask;
 import com.ericsson.gerrit.plugins.gcconductor.EvaluationTask.Factory;
+import com.google.gerrit.entities.Project;
 import com.google.gerrit.extensions.events.GitReferenceUpdatedListener;
-import com.google.gerrit.reviewdb.client.Project;
 import com.google.gerrit.server.git.GitRepositoryManager;
 import java.io.File;
 import java.io.IOException;
@@ -43,7 +43,7 @@
 public class EvaluatorTest {
   private static final String REPOSITORY_PATH = "/path/someRepo.git";
   private static final String REPOSITORY_PATH_OTHER = "/path/otherRepo.git";
-  private static final Project.NameKey NAME_KEY = new Project.NameKey("testProject");
+  private static final Project.NameKey NAME_KEY = Project.nameKey("testProject");
 
   @Mock private GitReferenceUpdatedListener.Event event;
   @Mock private GitRepositoryManager repoManager;
diff --git a/src/test/java/com/ericsson/gerrit/plugins/gcconductor/executor/ConfigUtilTest.java b/src/test/java/com/ericsson/gerrit/plugins/gcconductor/executor/ConfigUtilTest.java
index c99201a..1485d72 100644
--- a/src/test/java/com/ericsson/gerrit/plugins/gcconductor/executor/ConfigUtilTest.java
+++ b/src/test/java/com/ericsson/gerrit/plugins/gcconductor/executor/ConfigUtilTest.java
@@ -15,6 +15,7 @@
 package com.ericsson.gerrit.plugins.gcconductor.executor;
 
 import static com.google.common.truth.Truth.assertThat;
+import static com.google.gerrit.testing.GerritJUnit.assertThrows;
 import static java.util.concurrent.TimeUnit.DAYS;
 import static java.util.concurrent.TimeUnit.HOURS;
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
@@ -52,22 +53,24 @@
         .isEqualTo(DEFAULT_VALUE);
   }
 
-  @Test(expected = IllegalArgumentException.class)
+  @Test
   public void testGetTimeThrowsExceptionIfNegativeValue() {
     when(config.getString("", null, "")).thenReturn("-1");
-    assertThat(ConfigUtil.getTimeUnit(config, "", "", DEFAULT_VALUE, DAYS))
-        .isEqualTo(DEFAULT_VALUE);
+    assertThrows(
+        IllegalArgumentException.class,
+        () -> ConfigUtil.getTimeUnit(config, "", "", DEFAULT_VALUE, DAYS));
 
     when(config.getString("", null, "")).thenReturn("");
     assertThat(ConfigUtil.getTimeUnit(config, "", "", DEFAULT_VALUE, DAYS))
         .isEqualTo(DEFAULT_VALUE);
   }
 
-  @Test(expected = IllegalArgumentException.class)
+  @Test
   public void testGetTimeThrowsExceptionIfBadTimeUnit() {
     when(config.getString("", null, "")).thenReturn("1s");
-    assertThat(ConfigUtil.getTimeUnit(config, "", "", DEFAULT_VALUE, DAYS))
-        .isEqualTo(DEFAULT_VALUE);
+    assertThrows(
+        IllegalArgumentException.class,
+        () -> ConfigUtil.getTimeUnit(config, "", "", DEFAULT_VALUE, DAYS));
   }
 
   @Test
@@ -99,9 +102,9 @@
     assertEquals(ms(1, MILLISECONDS), parse(""));
   }
 
-  @Test(expected = IllegalArgumentException.class)
+  @Test
   public void testUnsupportedTimeUnit() {
-    parse("1 min");
+    assertThrows(IllegalArgumentException.class, () -> parse("1 min"));
   }
 
   private static long ms(int cnt, TimeUnit unit) {
diff --git a/src/test/java/com/ericsson/gerrit/plugins/gcconductor/executor/ExecutorModuleTest.java b/src/test/java/com/ericsson/gerrit/plugins/gcconductor/executor/ExecutorModuleTest.java
index f4d3cef..3e88f2b 100644
--- a/src/test/java/com/ericsson/gerrit/plugins/gcconductor/executor/ExecutorModuleTest.java
+++ b/src/test/java/com/ericsson/gerrit/plugins/gcconductor/executor/ExecutorModuleTest.java
@@ -15,7 +15,7 @@
 package com.ericsson.gerrit.plugins.gcconductor.executor;
 
 import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.fail;
+import static com.google.common.truth.Truth8.assertThat;
 import static org.mockito.Mockito.when;
 
 import com.google.inject.Binder;
@@ -45,9 +45,7 @@
     String host = "hostname";
     when(execCfg.isPickOwnHostOnly()).thenReturn(true);
     Optional<String> wasQueuedFrom = executorModule.wasQueuedFrom(execCfg, host);
-    if (!wasQueuedFrom.isPresent()) {
-      fail("wasQueued from is empty");
-    }
+    assertThat(wasQueuedFrom).isPresent();
     assertThat(wasQueuedFrom.get()).isEqualTo(host);
 
     when(execCfg.isPickOwnHostOnly()).thenReturn(false);
diff --git a/src/test/java/com/ericsson/gerrit/plugins/gcconductor/executor/ScheduledEvaluationTaskTest.java b/src/test/java/com/ericsson/gerrit/plugins/gcconductor/executor/ScheduledEvaluationTaskTest.java
index c560fbf..302c4c8 100644
--- a/src/test/java/com/ericsson/gerrit/plugins/gcconductor/executor/ScheduledEvaluationTaskTest.java
+++ b/src/test/java/com/ericsson/gerrit/plugins/gcconductor/executor/ScheduledEvaluationTaskTest.java
@@ -14,6 +14,7 @@
 
 package com.ericsson.gerrit.plugins.gcconductor.executor;
 
+import static com.google.gerrit.testing.GerritJUnit.assertThrows;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyZeroInteractions;
@@ -50,10 +51,12 @@
     periodicEvaluator = new ScheduledEvaluationTask(evaluationTaskFactory, config);
   }
 
-  @Test(expected = ProvisionException.class)
-  public void shouldThrowAnExceptionOnInvalidrepositoryPath() {
+  @Test
+  public void shouldThrowAnExceptionOnInvalidrepositoryPath() throws Exception {
     when(config.getRepositoriesPath()).thenReturn("unexistingPath");
-    periodicEvaluator = new ScheduledEvaluationTask(evaluationTaskFactory, config);
+    assertThrows(
+        ProvisionException.class,
+        () -> periodicEvaluator = new ScheduledEvaluationTask(evaluationTaskFactory, config));
   }
 
   @Test
diff --git a/src/test/java/com/ericsson/gerrit/plugins/gcconductor/postgresqueue/PostgresModuleTest.java b/src/test/java/com/ericsson/gerrit/plugins/gcconductor/postgresqueue/PostgresModuleTest.java
index 5df97d0..7721b8c 100644
--- a/src/test/java/com/ericsson/gerrit/plugins/gcconductor/postgresqueue/PostgresModuleTest.java
+++ b/src/test/java/com/ericsson/gerrit/plugins/gcconductor/postgresqueue/PostgresModuleTest.java
@@ -18,6 +18,7 @@
 import static com.ericsson.gerrit.plugins.gcconductor.postgresqueue.TestUtil.invalidConfigMockFor;
 import static com.ericsson.gerrit.plugins.gcconductor.postgresqueue.TestUtil.newContainer;
 import static com.google.common.truth.Truth.assertThat;
+import static com.google.gerrit.testing.GerritJUnit.assertThrows;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 
@@ -73,9 +74,10 @@
     assertThat(dataSource.isClosed()).isFalse();
   }
 
-  @Test(expected = SQLException.class)
-  public void shouldFailIfDatabaseNameIsInvalid() throws SQLException {
-    module.provideGcDatabaseAccess(invalidConfigMockFor(container));
+  @Test
+  public void shouldFailIfDatabaseNameIsInvalid() throws Exception {
+    assertThrows(
+        SQLException.class, () -> module.provideGcDatabaseAccess(invalidConfigMockFor(container)));
   }
 
   @Test
@@ -87,11 +89,11 @@
     assertThat(dataSource.isClosed()).isTrue();
   }
 
-  @Test(expected = RuntimeException.class)
-  public void shouldThrowExceptionIfFailsToCloseDatabaseAccess() throws SQLException {
+  @Test
+  public void shouldThrowExceptionIfFailsToCloseDatabaseAccess() throws Exception {
     BasicDataSource dataSouceMock = mock(BasicDataSource.class);
     doThrow(new SQLException("somme error")).when(dataSouceMock).close();
     DatabaseAccessCleanUp dbCleanUp = new DatabaseAccessCleanUp(dataSouceMock);
-    dbCleanUp.onShutdown();
+    assertThrows(RuntimeException.class, () -> dbCleanUp.onShutdown());
   }
 }
diff --git a/src/test/java/com/ericsson/gerrit/plugins/gcconductor/postgresqueue/PostgresQueueTest.java b/src/test/java/com/ericsson/gerrit/plugins/gcconductor/postgresqueue/PostgresQueueTest.java
index b767d04..aab695c 100644
--- a/src/test/java/com/ericsson/gerrit/plugins/gcconductor/postgresqueue/PostgresQueueTest.java
+++ b/src/test/java/com/ericsson/gerrit/plugins/gcconductor/postgresqueue/PostgresQueueTest.java
@@ -17,7 +17,7 @@
 import static com.ericsson.gerrit.plugins.gcconductor.postgresqueue.TestUtil.configMockFor;
 import static com.ericsson.gerrit.plugins.gcconductor.postgresqueue.TestUtil.newContainer;
 import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.fail;
+import static com.google.gerrit.testing.GerritJUnit.assertThrows;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
@@ -52,33 +52,33 @@
   }
 
   @Before
-  public void setUp() throws SQLException, GcQueueException {
+  public void setUp() throws Exception {
     dataSource = new PostgresModule(null).provideGcDatabaseAccess(configMockFor(container));
     queue = new PostgresQueue(dataSource);
     emptyQueue();
   }
 
   @After
-  public void tearDown() throws SQLException {
+  public void tearDown() throws Exception {
     if (dataSource != null) {
       dataSource.close();
     }
   }
 
   @Test
-  public void shouldCreateSchemaOnInit() throws GcQueueException {
+  public void shouldCreateSchemaOnInit() throws Exception {
     assertThat(queue.list()).isEmpty();
   }
 
-  @Test(expected = SQLException.class)
+  @Test
   public void shouldThrowExceptionIfFailsToCreateSchemaOnInit() throws Exception {
     BasicDataSource dataSouceMock = mock(BasicDataSource.class);
     when(dataSouceMock.getConnection()).thenThrow(new SQLException("some message"));
-    queue = new PostgresQueue(dataSouceMock);
+    assertThrows(SQLException.class, () -> queue = new PostgresQueue(dataSouceMock));
   }
 
   @Test
-  public void testAddContainsAndRemove() throws GcQueueException {
+  public void testAddContainsAndRemove() throws Exception {
     String repoPath = "/some/path/to/some/repository";
     String hostname = "someHostname";
 
@@ -115,68 +115,68 @@
     assertThat(queue.contains(repoPath)).isFalse();
   }
 
-  @Test(expected = GcQueueException.class)
+  @Test
   public void testAddThatFailsWhenGettingConnection() throws Exception {
     queue = new PostgresQueue(createDataSourceThatFailsWhenGettingConnection());
-    queue.add("repo", "hostname");
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testAddThatFailsWhenCreatingStatement() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenCreatingStatement());
-    queue.add("repo", "hostname");
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testAddThatFailsWhenExecutingQuery() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenExecutingQuery());
-    queue.add("repo", "hostname");
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testContainsThatFailsWhenGettingConnection() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenGettingConnection());
-    queue.contains("repo");
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testContainsThatFailsWhenCreatingStatement() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenCreatingStatement());
-    queue.contains("repo");
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testContainsThatFailsWhenExecutingQuery() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenExecutingQuery());
-    queue.contains("repo");
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testContainsThatFailsWhenIteratingResults() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenIteratingResults());
-    queue.contains("repo");
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testRemoveThatFailsWhenGettingConnection() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenGettingConnection());
-    queue.remove("repo");
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testRemoveThatFailsWhenCreatingStatement() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenCreatingStatement());
-    queue.remove("repo");
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testRemoveThatFailsWhenExecutingQuery() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenExecutingQuery());
-    queue.remove("repo");
+    assertThrows(GcQueueException.class, () -> queue.add("repo", "hostname"));
   }
 
   @Test
-  public void testList() throws GcQueueException {
+  public void testAddThatFailsWhenCreatingStatement() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenCreatingStatement());
+    assertThrows(GcQueueException.class, () -> queue.add("repo", "hostname"));
+  }
+
+  @Test
+  public void testAddThatFailsWhenExecutingQuery() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenExecutingQuery());
+    assertThrows(GcQueueException.class, () -> queue.add("repo", "hostname"));
+  }
+
+  @Test
+  public void testContainsThatFailsWhenGettingConnection() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenGettingConnection());
+    assertThrows(GcQueueException.class, () -> queue.contains("repo"));
+  }
+
+  @Test
+  public void testContainsThatFailsWhenCreatingStatement() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenCreatingStatement());
+    assertThrows(GcQueueException.class, () -> queue.contains("repo"));
+  }
+
+  @Test
+  public void testContainsThatFailsWhenExecutingQuery() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenExecutingQuery());
+    assertThrows(GcQueueException.class, () -> queue.contains("repo"));
+  }
+
+  @Test
+  public void testContainsThatFailsWhenIteratingResults() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenIteratingResults());
+    assertThrows(GcQueueException.class, () -> queue.contains("repo"));
+  }
+
+  @Test
+  public void testRemoveThatFailsWhenGettingConnection() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenGettingConnection());
+    assertThrows(GcQueueException.class, () -> queue.remove("repo"));
+  }
+
+  @Test
+  public void testRemoveThatFailsWhenCreatingStatement() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenCreatingStatement());
+    assertThrows(GcQueueException.class, () -> queue.remove("repo"));
+  }
+
+  @Test
+  public void testRemoveThatFailsWhenExecutingQuery() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenExecutingQuery());
+    assertThrows(GcQueueException.class, () -> queue.remove("repo"));
+  }
+
+  @Test
+  public void testList() throws Exception {
     String repoPath = "/some/path/to/some/repository.git";
     String repoPath2 = "/some/path/to/some/repository2.git";
     String hostname = "hostname";
@@ -208,32 +208,32 @@
     assertThat(timestampDiff).isAtMost(TimeUnit.SECONDS.toMillis(1));
   }
 
-  @Test(expected = GcQueueException.class)
+  @Test
   public void testListThatFailsWhenGettingConnection() throws Exception {
     queue = new PostgresQueue(createDataSourceThatFailsWhenGettingConnection());
-    queue.list();
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testListThatFailsWhenCreatingStatement() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenCreatingStatement());
-    queue.list();
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testListThatFailsWhenExecutingQuery() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenExecutingQuery());
-    queue.list();
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testListThatFailsWhenIteratingResults() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenIteratingResults());
-    queue.list();
+    assertThrows(GcQueueException.class, () -> queue.list());
   }
 
   @Test
-  public void testPick() throws GcQueueException {
+  public void testListThatFailsWhenCreatingStatement() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenCreatingStatement());
+    assertThrows(GcQueueException.class, () -> queue.list());
+  }
+
+  @Test
+  public void testListThatFailsWhenExecutingQuery() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenExecutingQuery());
+    assertThrows(GcQueueException.class, () -> queue.list());
+  }
+
+  @Test
+  public void testListThatFailsWhenIteratingResults() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenIteratingResults());
+    assertThrows(GcQueueException.class, () -> queue.list());
+  }
+
+  @Test
+  public void testPick() throws Exception {
     String repoPath = "/some/path/to/some/repository";
     String hostname = "someHostname";
     String executor = "someExecutor";
@@ -262,7 +262,7 @@
   }
 
   @Test
-  public void testPickRepositoriesInOrder() throws GcQueueException {
+  public void testPickRepositoriesInOrder() throws Exception {
     String repositoryFormat = "my/path%s.git";
     for (int i = 0; i < 100; i++) {
       queue.add(String.format(repositoryFormat, i), "someHostname");
@@ -275,7 +275,7 @@
   }
 
   @Test
-  public void testPickInQueueForLongerThan() throws GcQueueException, InterruptedException {
+  public void testPickInQueueForLongerThan() throws Exception {
     String repoPath = "/some/path/to/some/repository";
     String hostname = "someHostname";
     String executor = "someExecutor";
@@ -293,7 +293,7 @@
   }
 
   @Test
-  public void testPickQueuedFrom() throws GcQueueException {
+  public void testPickQueuedFrom() throws Exception {
     String repoPath = "/some/path/to/some/repository";
     String hostname = "hostname";
     String otherHostname = "otherHostname";
@@ -310,32 +310,32 @@
     assertThat(picked.getExecutor()).isEqualTo(executor);
   }
 
-  @Test(expected = GcQueueException.class)
+  @Test
   public void testPickThatFailsWhenGettingConnection() throws Exception {
     queue = new PostgresQueue(createDataSourceThatFailsWhenGettingConnection());
-    queue.pick("executor", 0, Optional.empty());
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testPickThatFailsWhenCreatingStatement() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenCreatingStatement());
-    queue.pick("executor", 0, Optional.empty());
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testPickThatFailsWhenExecutingQuery() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenExecutingQuery());
-    queue.pick("executor", 0, Optional.empty());
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testPickThatFailsWhenIteratingResults() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenIteratingResults());
-    queue.pick("executor", 0, Optional.empty());
+    assertThrows(GcQueueException.class, () -> queue.pick("executor", 0, Optional.empty()));
   }
 
   @Test
-  public void testUnpick() throws GcQueueException {
+  public void testPickThatFailsWhenCreatingStatement() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenCreatingStatement());
+    assertThrows(GcQueueException.class, () -> queue.pick("executor", 0, Optional.empty()));
+  }
+
+  @Test
+  public void testPickThatFailsWhenExecutingQuery() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenExecutingQuery());
+    assertThrows(GcQueueException.class, () -> queue.pick("executor", 0, Optional.empty()));
+  }
+
+  @Test
+  public void testPickThatFailsWhenIteratingResults() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenIteratingResults());
+    assertThrows(GcQueueException.class, () -> queue.pick("executor", 0, Optional.empty()));
+  }
+
+  @Test
+  public void testUnpick() throws Exception {
     String repoPath = "/some/path/to/some/repository";
     String hostname = "someHostname";
     String executor = "someExecutor";
@@ -354,26 +354,26 @@
     assertThat(picked.getExecutor()).isEqualTo(executor);
   }
 
-  @Test(expected = GcQueueException.class)
+  @Test
   public void testUnpickThatFailsWhenGettingConnection() throws Exception {
     queue = new PostgresQueue(createDataSourceThatFailsWhenGettingConnection());
-    queue.unpick("/some/path/to/some/repository.git");
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testUnpickFailsWhenCreatingStatement() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenCreatingStatement());
-    queue.unpick("/some/path/to/some/repository.git");
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testUnpickThatFailsWhenExecutingQuery() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenExecutingQuery());
-    queue.unpick("/some/path/to/some/repository.git");
+    assertThrows(GcQueueException.class, () -> queue.unpick("/some/path/to/some/repository.git"));
   }
 
   @Test
-  public void testResetQueuedFrom() throws GcQueueException {
+  public void testUnpickFailsWhenCreatingStatement() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenCreatingStatement());
+    assertThrows(GcQueueException.class, () -> queue.unpick("/some/path/to/some/repository.git"));
+  }
+
+  @Test
+  public void testUnpickThatFailsWhenExecutingQuery() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenExecutingQuery());
+    assertThrows(GcQueueException.class, () -> queue.unpick("/some/path/to/some/repository.git"));
+  }
+
+  @Test
+  public void testResetQueuedFrom() throws Exception {
     String repoPath = "/some/path/to/some/repository";
     String repoPath2 = "/some/path/to/some/repository2";
     String hostname = "hostname";
@@ -389,26 +389,26 @@
     assertThat(queue.list().get(1).getQueuedFrom()).isEqualTo(otherHostname);
   }
 
-  @Test(expected = GcQueueException.class)
+  @Test
   public void testResetQueuedFromThatFailsWhenGettingConnection() throws Exception {
     queue = new PostgresQueue(createDataSourceThatFailsWhenGettingConnection());
-    queue.resetQueuedFrom("someHostname");
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testResetQueuedFromFailsWhenCreatingStatement() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenCreatingStatement());
-    queue.resetQueuedFrom("someHostname");
-  }
-
-  @Test(expected = GcQueueException.class)
-  public void testResetQueuedFromThatFailsWhenExecutingQuery() throws Exception {
-    queue = new PostgresQueue(createDataSourceThatFailsWhenExecutingQuery());
-    queue.resetQueuedFrom("someHostname");
+    assertThrows(GcQueueException.class, () -> queue.resetQueuedFrom("someHostname"));
   }
 
   @Test
-  public void testBumpToFirst() throws GcQueueException {
+  public void testResetQueuedFromFailsWhenCreatingStatement() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenCreatingStatement());
+    assertThrows(GcQueueException.class, () -> queue.resetQueuedFrom("someHostname"));
+  }
+
+  @Test
+  public void testResetQueuedFromThatFailsWhenExecutingQuery() throws Exception {
+    queue = new PostgresQueue(createDataSourceThatFailsWhenExecutingQuery());
+    assertThrows(GcQueueException.class, () -> queue.resetQueuedFrom("someHostname"));
+  }
+
+  @Test
+  public void testBumpToFirst() throws Exception {
     String repoPath = "/some/path/to/some/repository";
     String repoPath2 = "/some/path/to/some/repository2";
     String repoPath3 = "/some/path/to/some/repository3";
@@ -439,25 +439,25 @@
     assertThat(queue.list().get(2).getPath()).isEqualTo(repoPath2);
   }
 
-  @Test(expected = GcQueueException.class)
+  @Test
   public void testBumpToFirstThatFailsWhenGettingConnection() throws Exception {
     queue = new PostgresQueue(createDataSourceThatFailsWhenGettingConnection());
-    queue.bumpToFirst("someHostname");
+    assertThrows(GcQueueException.class, () -> queue.bumpToFirst("someHostname"));
   }
 
-  @Test(expected = GcQueueException.class)
+  @Test
   public void testBumpToFirstFailsWhenCreatingStatement() throws Exception {
     queue = new PostgresQueue(createDataSourceThatFailsWhenCreatingStatement());
-    queue.bumpToFirst("someHostname");
+    assertThrows(GcQueueException.class, () -> queue.bumpToFirst("someHostname"));
   }
 
-  @Test(expected = GcQueueException.class)
+  @Test
   public void testBumpToFirstThatFailsWhenExecutingQuery() throws Exception {
     queue = new PostgresQueue(createDataSourceThatFailsWhenExecutingQuery());
-    queue.bumpToFirst("someHostname");
+    assertThrows(GcQueueException.class, () -> queue.bumpToFirst("someHostname"));
   }
 
-  private BasicDataSource createDataSourceThatFailsWhenGettingConnection() throws SQLException {
+  private BasicDataSource createDataSourceThatFailsWhenGettingConnection() throws Exception {
     BasicDataSource dataSouceMock = mock(BasicDataSource.class);
     Connection connectionMock = mock(Connection.class);
     Statement statementMock = mock(Statement.class);
@@ -468,7 +468,7 @@
     return dataSouceMock;
   }
 
-  private BasicDataSource createDataSourceThatFailsWhenCreatingStatement() throws SQLException {
+  private BasicDataSource createDataSourceThatFailsWhenCreatingStatement() throws Exception {
     BasicDataSource dataSouceMock = mock(BasicDataSource.class);
     Connection connectionMock = mock(Connection.class);
     Statement statementMock = mock(Statement.class);
@@ -479,7 +479,7 @@
     return dataSouceMock;
   }
 
-  private BasicDataSource createDataSourceThatFailsWhenExecutingQuery() throws SQLException {
+  private BasicDataSource createDataSourceThatFailsWhenExecutingQuery() throws Exception {
     BasicDataSource dataSouceMock = mock(BasicDataSource.class);
     Connection connectionMock = mock(Connection.class);
     Statement statementMock = mock(Statement.class);
@@ -492,7 +492,7 @@
     return dataSouceMock;
   }
 
-  private BasicDataSource createDataSourceThatFailsWhenIteratingResults() throws SQLException {
+  private BasicDataSource createDataSourceThatFailsWhenIteratingResults() throws Exception {
     BasicDataSource dataSouceMock = mock(BasicDataSource.class);
     Connection connectionMock = mock(Connection.class);
     Statement statementMock = mock(Statement.class);
@@ -506,17 +506,16 @@
     return dataSouceMock;
   }
 
-  private void emptyQueue() throws GcQueueException {
-    queue.list().stream()
-        .map(RepositoryInfo::getPath)
-        .forEach(
-            repository -> {
-              try {
-                queue.remove(repository);
-              } catch (GcQueueException e) {
-                fail();
-              }
-            });
+  private void emptyQueue() throws Exception {
+    queue.list().stream().map(RepositoryInfo::getPath).forEach(this::doEmptyQueue);
     assertThat(queue.list()).isEmpty();
   }
+
+  private void doEmptyQueue(String repository) {
+    try {
+      queue.remove(repository);
+    } catch (GcQueueException e) {
+      throw new RuntimeException(e);
+    }
+  }
 }
