Adapt to Gerrit v3.0 test API
Gerrit v3.0 has different methods for creating a test
repository in its test automation framework.
JUnit also has been upgraded to v4 and the class rule
for creating the temporary folder needs to be explicitly
invoked.
Change-Id: I1584e2842fcdfbebd4ad7f9dfb26feaa84fd384c
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 f10c772..5fe8a57 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
@@ -19,6 +19,7 @@
import com.google.gerrit.acceptance.{AbstractDaemonTest, GitUtil}
import com.google.gerrit.extensions.annotations.PluginName
+import com.google.gerrit.extensions.client.SubmitType
import com.google.gerrit.reviewdb.client.Project
import com.google.inject.{AbstractModule, Module}
import org.eclipse.jgit.api.MergeCommand.FastForwardMode
@@ -136,16 +137,17 @@
object GerritTestDaemon extends AbstractDaemonTest {
baseConfig = new Config()
+ AbstractDaemonTest.temporaryFolder.create()
def newProject(nameSuffix: String) = {
resourcePrefix = ""
- super.createProject(nameSuffix, allProjects, false)
+ super.createProjectOverAPI(nameSuffix, allProjects, false, SubmitType.MERGE_IF_NECESSARY)
}
def getRepository(projectName: Project.NameKey): FileRepository =
repoManager.openRepository(projectName).asInstanceOf[FileRepository]
- def adminAuthor = admin.getIdent
+ def adminAuthor = admin.newIdent
def getInstance[T](clazz: Class[T]): T =
server.getTestInjector.getInstance(clazz)