Merge branch 'stable-3.2'

* stable-3.2:
  Fix documentation error regarding soy template
  Extend CommitMessageFetcher to handle non-commit objects

Change-Id: Ic0e10bc739f7b958cd9ac29aead5bf44f2dff2ba
diff --git a/src/main/java/com/googlesource/gerrit/plugins/its/base/its/InitIts.java b/src/main/java/com/googlesource/gerrit/plugins/its/base/its/InitIts.java
index fbb6e39..91e84a1 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/its/base/its/InitIts.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/its/base/its/InitIts.java
@@ -15,7 +15,7 @@
 package com.googlesource.gerrit.plugins.its.base.its;
 
 import com.google.common.base.Strings;
-import com.google.gerrit.common.data.AccessSection;
+import com.google.gerrit.entities.AccessSection;
 import com.google.gerrit.pgm.init.api.AllProjectsConfig;
 import com.google.gerrit.pgm.init.api.AllProjectsNameOnInitProvider;
 import com.google.gerrit.pgm.init.api.ConsoleUI;
diff --git a/src/main/java/com/googlesource/gerrit/plugins/its/base/its/ItsConfig.java b/src/main/java/com/googlesource/gerrit/plugins/its/base/its/ItsConfig.java
index 3429ba4..668ff1e 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/its/base/its/ItsConfig.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/its/base/its/ItsConfig.java
@@ -18,7 +18,7 @@
 
 import com.google.common.flogger.FluentLogger;
 import com.google.gerrit.common.Nullable;
-import com.google.gerrit.common.data.AccessSection;
+import com.google.gerrit.entities.AccessSection;
 import com.google.gerrit.entities.Project;
 import com.google.gerrit.entities.Project.NameKey;
 import com.google.gerrit.extensions.annotations.PluginName;
@@ -274,7 +274,7 @@
             "Cannot access %s configuration for plugin %s", projectName, pluginName);
       }
     }
-    return new PluginConfig(pluginName, new Config());
+    return PluginConfig.create(pluginName, new Config(), null);
   }
 
   private List<CommentLinkInfo> getCommentLinkInfo(final String commentlinkName) {
diff --git a/src/test/java/com/googlesource/gerrit/plugins/its/base/validation/ItsValidateCommentTest.java b/src/test/java/com/googlesource/gerrit/plugins/its/base/validation/ItsValidateCommentTest.java
index 433c43e..de86e86 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/its/base/validation/ItsValidateCommentTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/its/base/validation/ItsValidateCommentTest.java
@@ -51,7 +51,8 @@
   private ItsConfig itsConfig;
   private ItsFacadeFactory itsFacadeFactory;
 
-  private Project project = new Project(Project.nameKey("myProject"));
+  private Project.NameKey projectName = Project.nameKey("myProject");
+  private Project project = Project.builder(projectName).build();
 
   public void testOptional() throws CommitValidationException {
     List<CommitValidationMessage> ret;
@@ -139,7 +140,7 @@
     CommitReceivedEvent event = newCommitReceivedEvent(command, project, null, commit, null);
     when(itsConfig.getItsAssociationPolicy()).thenReturn(ItsAssociationPolicy.SUGGESTED);
     when(issueExtractor.getIssueIds("bug#4711")).thenReturn(new String[] {"4711"});
-    when(itsFacadeFactory.getFacade(project.getNameKey())).thenReturn(itsFacade);
+    when(itsFacadeFactory.getFacade(projectName)).thenReturn(itsFacade);
     when(itsFacade.exists("4711")).thenReturn(true);
 
     ret = ivc.onCommitReceived(event);
@@ -160,7 +161,7 @@
 
     when(itsConfig.getItsAssociationPolicy()).thenReturn(ItsAssociationPolicy.MANDATORY);
     when(issueExtractor.getIssueIds("bug#4711")).thenReturn(new String[] {"4711"});
-    when(itsFacadeFactory.getFacade(project.getNameKey())).thenReturn(itsFacade);
+    when(itsFacadeFactory.getFacade(projectName)).thenReturn(itsFacade);
     when(itsFacade.exists("4711")).thenReturn(true);
 
     ret = ivc.onCommitReceived(event);
@@ -182,7 +183,7 @@
 
     when(itsConfig.getItsAssociationPolicy()).thenReturn(ItsAssociationPolicy.SUGGESTED);
     when(issueExtractor.getIssueIds("bug#4711")).thenReturn(new String[] {"4711"});
-    when(itsFacadeFactory.getFacade(project.getNameKey())).thenReturn(itsFacade);
+    when(itsFacadeFactory.getFacade(projectName)).thenReturn(itsFacade);
     when(itsFacade.exists("4711")).thenReturn(false);
 
     ret = ivc.onCommitReceived(event);
@@ -208,7 +209,7 @@
 
     when(itsConfig.getItsAssociationPolicy()).thenReturn(ItsAssociationPolicy.MANDATORY);
     when(issueExtractor.getIssueIds("bug#4711")).thenReturn(new String[] {"4711"});
-    when(itsFacadeFactory.getFacade(project.getNameKey())).thenReturn(itsFacade);
+    when(itsFacadeFactory.getFacade(projectName)).thenReturn(itsFacade);
     when(itsFacade.exists("4711")).thenReturn(false);
 
     CommitValidationException thrown =
@@ -229,7 +230,7 @@
 
     when(itsConfig.getItsAssociationPolicy()).thenReturn(ItsAssociationPolicy.SUGGESTED);
     when(issueExtractor.getIssueIds("bug#4711, bug#42")).thenReturn(new String[] {"4711", "42"});
-    when(itsFacadeFactory.getFacade(project.getNameKey())).thenReturn(itsFacade);
+    when(itsFacadeFactory.getFacade(projectName)).thenReturn(itsFacade);
     when(itsFacade.exists("4711")).thenReturn(true);
     when(itsFacade.exists("42")).thenReturn(true);
 
@@ -251,7 +252,7 @@
 
     when(itsConfig.getItsAssociationPolicy()).thenReturn(ItsAssociationPolicy.MANDATORY);
     when(issueExtractor.getIssueIds("bug#4711, bug#42")).thenReturn(new String[] {"4711", "42"});
-    when(itsFacadeFactory.getFacade(project.getNameKey())).thenReturn(itsFacade);
+    when(itsFacadeFactory.getFacade(projectName)).thenReturn(itsFacade);
     when(itsFacade.exists("4711")).thenReturn(true);
     when(itsFacade.exists("42")).thenReturn(true);
 
@@ -275,7 +276,7 @@
 
     when(itsConfig.getItsAssociationPolicy()).thenReturn(ItsAssociationPolicy.SUGGESTED);
     when(issueExtractor.getIssueIds("bug#4711, bug#42")).thenReturn(new String[] {"4711", "42"});
-    when(itsFacadeFactory.getFacade(project.getNameKey())).thenReturn(itsFacade);
+    when(itsFacadeFactory.getFacade(projectName)).thenReturn(itsFacade);
     when(itsFacade.exists("4711")).thenReturn(false);
     when(itsFacade.exists("42")).thenReturn(true);
 
@@ -306,7 +307,7 @@
 
     when(itsConfig.getItsAssociationPolicy()).thenReturn(ItsAssociationPolicy.MANDATORY);
     when(issueExtractor.getIssueIds("bug#4711, bug#42")).thenReturn(new String[] {"4711", "42"});
-    when(itsFacadeFactory.getFacade(project.getNameKey())).thenReturn(itsFacade);
+    when(itsFacadeFactory.getFacade(projectName)).thenReturn(itsFacade);
     when(itsFacade.exists("4711")).thenReturn(false);
     when(itsFacade.exists("42")).thenReturn(true);
 
@@ -330,7 +331,7 @@
 
     when(itsConfig.getItsAssociationPolicy()).thenReturn(ItsAssociationPolicy.SUGGESTED);
     when(issueExtractor.getIssueIds("bug#4711, bug#42")).thenReturn(new String[] {"4711", "42"});
-    when(itsFacadeFactory.getFacade(project.getNameKey())).thenReturn(itsFacade);
+    when(itsFacadeFactory.getFacade(projectName)).thenReturn(itsFacade);
     when(itsFacade.exists("4711")).thenReturn(false);
     when(itsFacade.exists("42")).thenReturn(false);
 
@@ -361,7 +362,7 @@
 
     when(itsConfig.getItsAssociationPolicy()).thenReturn(ItsAssociationPolicy.MANDATORY);
     when(issueExtractor.getIssueIds("bug#4711, bug#42")).thenReturn(new String[] {"4711", "42"});
-    when(itsFacadeFactory.getFacade(project.getNameKey())).thenReturn(itsFacade);
+    when(itsFacadeFactory.getFacade(projectName)).thenReturn(itsFacade);
     when(itsFacade.exists("4711")).thenReturn(false);
     when(itsFacade.exists("42")).thenReturn(true);
 
@@ -385,7 +386,7 @@
 
     when(itsConfig.getItsAssociationPolicy()).thenReturn(ItsAssociationPolicy.SUGGESTED);
     when(issueExtractor.getIssueIds("bug#4711, bug#42")).thenReturn(new String[] {"4711", "42"});
-    when(itsFacadeFactory.getFacade(project.getNameKey())).thenReturn(itsFacade);
+    when(itsFacadeFactory.getFacade(projectName)).thenReturn(itsFacade);
     doThrow(new IOException("InjectedEx1")).when(itsFacade).exists("4711");
     when(itsFacade.exists("42")).thenReturn(false);
 
@@ -430,7 +431,7 @@
 
     when(itsConfig.getItsAssociationPolicy()).thenReturn(ItsAssociationPolicy.MANDATORY);
     when(issueExtractor.getIssueIds("bug#4711")).thenReturn(new String[] {"4711"});
-    when(itsFacadeFactory.getFacade(project.getNameKey())).thenReturn(itsFacade);
+    when(itsFacadeFactory.getFacade(projectName)).thenReturn(itsFacade);
     doThrow(new IOException("InjectedEx1")).when(itsFacade).exists("4711");
 
     ret = ivc.onCommitReceived(event);
@@ -461,7 +462,7 @@
 
     when(itsConfig.getItsAssociationPolicy()).thenReturn(ItsAssociationPolicy.MANDATORY);
     when(issueExtractor.getIssueIds("bug#4711, bug#42")).thenReturn(new String[] {"4711", "42"});
-    when(itsFacadeFactory.getFacade(project.getNameKey())).thenReturn(itsFacade);
+    when(itsFacadeFactory.getFacade(projectName)).thenReturn(itsFacade);
     doThrow(new IOException("InjectedEx1")).when(itsFacade).exists("4711");
     when(itsFacade.exists("42")).thenReturn(false);
 
@@ -491,7 +492,7 @@
 
     when(itsConfig.getItsAssociationPolicy()).thenReturn(ItsAssociationPolicy.MANDATORY);
     when(issueExtractor.getIssueIds("bug#4711, bug#42")).thenReturn(new String[] {"4711", "42"});
-    when(itsFacadeFactory.getFacade(project.getNameKey())).thenReturn(itsFacade);
+    when(itsFacadeFactory.getFacade(projectName)).thenReturn(itsFacade);
     doThrow(new IOException("InjectedEx1")).when(itsFacade).exists("4711");
     when(itsFacade.exists("42")).thenReturn(true);