Merge branch 'stable-3.10'

* stable-3.10:
  Bump Gerrit to v3.10.0-rc2

Change-Id: I6e1790e0d1f06d100049a9612394b51f8bdf4a62
diff --git a/build.sbt b/build.sbt
index 4140349..017d30f 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,6 +1,6 @@
 enablePlugins(GitVersioning)
 
-val gerritApiVersion = "3.9.0-rc2"
+val gerritApiVersion = "3.10.0-rc2"
 
 val pluginName = "analytics"
 
@@ -21,14 +21,14 @@
       "io.fabric8" % "gitective-core" % "0.9.54"
         exclude ("org.eclipse.jgit", "org.eclipse.jgit"),
 
-      "com.google.inject" % "guice" % "5.0.1" % Provided,
+      "com.google.inject" % "guice" % "6.0.0" % Provided,
       "com.google.gerrit" % "gerrit-plugin-api" % gerritApiVersion % Provided withSources(),
-      "com.google.code.gson" % "gson" % "2.8.5" % Provided,
+      "com.google.code.gson" % "gson" % "2.9.0" % Provided,
       "joda-time" % "joda-time" % "2.9.9",
       "org.scala-lang.modules" %% "scala-java8-compat" % "0.9.1",
 
       "com.google.gerrit" % "gerrit-acceptance-framework" % gerritApiVersion % Test,
-      "org.bouncycastle" % "bcpg-jdk15on" % "1.61" % Test,
+      "org.bouncycastle" % "bcpg-jdk18on" % "1.72" % Test,
       "org.scalatest" %% "scalatest" % "3.2.16" % Test,
       "net.codingwell" %% "scala-guice" % "5.0.0" % Test),
 
diff --git a/src/main/scala/com/googlesource/gerrit/plugins/analytics/SshModule.scala b/src/main/scala/com/googlesource/gerrit/plugins/analytics/SshModule.scala
index 01fe36d..569d865 100644
--- a/src/main/scala/com/googlesource/gerrit/plugins/analytics/SshModule.scala
+++ b/src/main/scala/com/googlesource/gerrit/plugins/analytics/SshModule.scala
@@ -15,8 +15,10 @@
 package com.googlesource.gerrit.plugins.analytics
 
 import com.google.gerrit.sshd.PluginCommandModule
+import com.google.gerrit.extensions.annotations.PluginName
+import com.google.inject.Inject
 
-class SshModule extends PluginCommandModule {
+class SshModule @Inject()(@PluginName val pluginName: String) extends PluginCommandModule(pluginName) {
 
   override protected def configureCommands = {
     command(classOf[ContributorsCommand])
diff --git a/src/test/scala/com/googlesource/gerrit/plugins/analytics/test/GerritTestDaemon.scala b/src/test/scala/com/googlesource/gerrit/plugins/analytics/test/GerritTestDaemon.scala
index 4d0df87..d793a46 100644
--- a/src/test/scala/com/googlesource/gerrit/plugins/analytics/test/GerritTestDaemon.scala
+++ b/src/test/scala/com/googlesource/gerrit/plugins/analytics/test/GerritTestDaemon.scala
@@ -35,7 +35,7 @@
 import org.eclipse.jgit.revwalk.RevCommit
 import org.gitective.core.CommitUtils
 import org.junit.runner.Description
-import org.junit.runners.model.Statement
+import org.junit.runners.model.{Statement, TestClass}
 import org.scalatest._
 
 trait GerritTestDaemon extends BeforeAndAfterEach {
@@ -45,18 +45,8 @@
 
   val daemonTest = GerritTestDaemon
 
-  protected abstract override def runTest(testName: String, args: Args): Status = {
-    var status: Status = FailedStatus
-    val runLambda = () => super.runTest(testName, args)
-
-    daemonTest.testRunner.apply(new Statement() {
-      override def evaluate(): Unit = {
-        status = runLambda.apply()
-      }
-    }, Description.createTestDescription(getClass.getName, testName)).evaluate()
-
-    status
-  }
+  protected abstract override def runTest(testName: String, args: Args): Status =
+    daemonTest.apply(getClass, testName, () => super.runTest(testName, args))
 
   var testFileRepository: TestFileRepository = _
 
@@ -175,6 +165,18 @@
 
   def restSession: RestSession = adminRestSession
 
+  def apply(testClass: Class[_], testName: String, runLambda: () => Status): Status = {
+    var status: Status = FailedStatus
+    val testDescription = Description.createTestDescription(testClass, testName)
+    val statement = new Statement() {
+      override def evaluate(): Unit = {
+        status = runLambda.apply()
+      }
+    }
+    configRule.apply(() => testRunner.apply(statement, testDescription).evaluate(), testDescription).evaluate()
+    status
+  }
+
   class TestModule extends AbstractModule {
     override def configure(): Unit = {
       bind(classOf[CommitsStatisticsCache]).to(classOf[CommitsStatisticsNoCache])