Adapt to Project.NameKey refactoring
Change-Id: Ic8d9bb19e9dc5d2d405783acd300734edf5b39ca
diff --git a/src/main/java/com/googlesource/gerrit/plugins/its/base/util/CommitMessageFetcher.java b/src/main/java/com/googlesource/gerrit/plugins/its/base/util/CommitMessageFetcher.java
index 905a2a3..7049e51 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/its/base/util/CommitMessageFetcher.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/its/base/util/CommitMessageFetcher.java
@@ -1,6 +1,6 @@
package com.googlesource.gerrit.plugins.its.base.util;
-import com.google.gerrit.reviewdb.client.Project.NameKey;
+import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.server.git.GitRepositoryManager;
import com.google.inject.Inject;
import java.io.IOException;
@@ -22,7 +22,7 @@
}
public String fetch(String projectName, String commitId) throws IOException {
- try (Repository repo = repoManager.openRepository(new NameKey(projectName))) {
+ try (Repository repo = repoManager.openRepository(Project.nameKey(projectName))) {
try (RevWalk revWalk = new RevWalk(repo)) {
RevCommit commit = revWalk.parseCommit(ObjectId.fromString(commitId));
return commit.getFullMessage();
diff --git a/src/main/java/com/googlesource/gerrit/plugins/its/base/util/ItsProjectExtractor.java b/src/main/java/com/googlesource/gerrit/plugins/its/base/util/ItsProjectExtractor.java
index e872f8d..734582a 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/its/base/util/ItsProjectExtractor.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/its/base/util/ItsProjectExtractor.java
@@ -29,6 +29,6 @@
}
public Optional<String> getItsProject(String gerritProjectName) {
- return itsConfig.getItsProjectName(new Project.NameKey(gerritProjectName));
+ return itsConfig.getItsProjectName(Project.nameKey(gerritProjectName));
}
}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/its/base/workflow/ActionExecutor.java b/src/main/java/com/googlesource/gerrit/plugins/its/base/workflow/ActionExecutor.java
index 355d1f3..33e82ae 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/its/base/workflow/ActionExecutor.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/its/base/workflow/ActionExecutor.java
@@ -80,7 +80,7 @@
private void execute(
Action action, String target, ActionRequest actionRequest, Map<String, String> properties)
throws IOException {
- ItsFacade its = itsFactory.getFacade(new Project.NameKey(properties.get("project")));
+ ItsFacade its = itsFactory.getFacade(Project.nameKey(properties.get("project")));
action.execute(its, target, actionRequest, properties);
}
@@ -89,7 +89,7 @@
try {
Action action = getAction(actionRequest.getName());
if (action == null) {
- ItsFacade its = itsFactory.getFacade(new Project.NameKey(properties.get("project")));
+ ItsFacade its = itsFactory.getFacade(Project.nameKey(properties.get("project")));
its.performAction(issue, actionRequest.getUnparsed());
} else if (action.getType() == ActionType.ISSUE) {
execute(action, issue, actionRequest, properties);
diff --git a/src/main/java/com/googlesource/gerrit/plugins/its/base/workflow/ItsRulesProjectCacheImpl.java b/src/main/java/com/googlesource/gerrit/plugins/its/base/workflow/ItsRulesProjectCacheImpl.java
index 7e37397..14307a0 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/its/base/workflow/ItsRulesProjectCacheImpl.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/its/base/workflow/ItsRulesProjectCacheImpl.java
@@ -98,7 +98,7 @@
@Override
public List<Rule> load(String projectName) throws IOException {
- ProjectState project = projectCache.checkedGet(new Project.NameKey(projectName));
+ ProjectState project = projectCache.checkedGet(Project.nameKey(projectName));
List<Rule> projectRules = readRulesFrom(project);
if (projectRules.isEmpty()) {
for (ProjectState parent : project.parents()) {