diff --git a/WORKSPACE b/WORKSPACE
index 86a6ded..5b89d45 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -3,27 +3,27 @@
 load("//:bazlets.bzl", "load_bazlets")
 
 load_bazlets(
-    commit = "0ca51936ca46049cddd34e971a595d3baafe731b",
+    commit = "7744d119c623494f7c7ec621e20cd66ea5bc04f6",
     #local_path = "/home/<user>/projects/bazlets",
 )
 
 # Snapshot Plugin API
-#load(
-#    "@com_googlesource_gerrit_bazlets//:gerrit_api_maven_local.bzl",
-#    "gerrit_api_maven_local",
-#)
-
-# Load snapshot Plugin API
-#gerrit_api_maven_local()
-
-# Release Plugin API
 load(
-    "@com_googlesource_gerrit_bazlets//:gerrit_api.bzl",
-    "gerrit_api",
+    "@com_googlesource_gerrit_bazlets//:gerrit_api_maven_local.bzl",
+    "gerrit_api_maven_local",
 )
 
+# Load snapshot Plugin API
+gerrit_api_maven_local()
+
+# Release Plugin API
+#load(
+#    "@com_googlesource_gerrit_bazlets//:gerrit_api.bzl",
+#    "gerrit_api",
+#)
+
 # Load release Plugin API
-gerrit_api()
+#gerrit_api()
 
 load("//:external_plugin_deps.bzl", "external_plugin_deps")
 
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..49ecb62 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
@@ -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..52cf01e 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
@@ -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..905d737 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
@@ -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);
+    }
+  }
 }
