Merge branch 'stable-3.2'

* stable-3.2:
  Fix broken CheckerRefMigrationTest
  Docs: Add missing comma to example responses
  Docs: remove trailing comma from example requests/responses
  Doc: Change CheckInput example to valid JSON

Change-Id: Ia4448b1ecb7a3313981d96a626ecaa99879245a3
diff --git a/java/com/google/gerrit/plugins/checks/db/CheckerRefMigration.java b/java/com/google/gerrit/plugins/checks/db/CheckerRefMigration.java
index 0ab110a..40eb858 100644
--- a/java/com/google/gerrit/plugins/checks/db/CheckerRefMigration.java
+++ b/java/com/google/gerrit/plugins/checks/db/CheckerRefMigration.java
@@ -13,6 +13,7 @@
 // limitations under the License.
 package com.google.gerrit.plugins.checks.db;
 
+import com.google.common.annotations.VisibleForTesting;
 import com.google.gerrit.entities.Project;
 import com.google.gerrit.pgm.init.api.AllProjectsNameOnInitProvider;
 import com.google.gerrit.plugins.checks.CheckerRef;
@@ -33,17 +34,22 @@
   private static final String LEGACY_REFS_META_CHECKERS = "refs/meta/checkers/";
 
   private final GitRepositoryManager repoManager;
-  private final AllProjectsNameOnInitProvider allProjectsName;
+  private final Project.NameKey allProjectsName;
 
   @Inject
   CheckerRefMigration(
-      GitRepositoryManager repoManager, AllProjectsNameOnInitProvider allProjectsName) {
+      GitRepositoryManager repoManager, AllProjectsNameOnInitProvider allProjectsNameProvider) {
+    this(repoManager, Project.nameKey(allProjectsNameProvider.get()));
+  }
+
+  @VisibleForTesting
+  CheckerRefMigration(GitRepositoryManager repoManager, Project.NameKey allProjectsName) {
     this.repoManager = repoManager;
     this.allProjectsName = allProjectsName;
   }
 
   public void migrate() throws Exception {
-    try (Repository repo = repoManager.openRepository(Project.nameKey(allProjectsName.get()))) {
+    try (Repository repo = repoManager.openRepository(allProjectsName)) {
 
       // This part is specifically for cases where the rename failed half-way last time.
       Ref ref = repo.exactRef(TMP_REF);
diff --git a/resources/Documentation/rest-api-checkers.md b/resources/Documentation/rest-api-checkers.md
index 534a479..06aa276 100644
--- a/resources/Documentation/rest-api-checkers.md
+++ b/resources/Documentation/rest-api-checkers.md
@@ -64,7 +64,7 @@
     "uuid": "test:my-checker",
     "name": "MyChecker",
     "description": "A simple checker.",
-    "repository": "examples/Foo",
+    "repository": "examples/Foo"
   }
 ```
 
diff --git a/resources/Documentation/rest-api-checks.md b/resources/Documentation/rest-api-checks.md
index fd31b87..239405a 100644
--- a/resources/Documentation/rest-api-checks.md
+++ b/resources/Documentation/rest-api-checks.md
@@ -40,7 +40,7 @@
       "checker_uuid": "test:my-checker",
       "state": "NOT_STARTED",
       "url": "https://foo.corp.com/test-checker/results/123",
-      "created": "2019-01-31 09:59:32.126000000"
+      "created": "2019-01-31 09:59:32.126000000",
       "updated": "2019-01-31 09:59:32.126000000"
     },
     {
@@ -49,7 +49,7 @@
       "patch_set_id": 1,
       "checker_uuid": "foo:foo-checker",
       "state": "FINISHED",
-      "created": "2019-01-31 09:59:32.126000000"
+      "created": "2019-01-31 09:59:32.126000000",
       "updated": "2019-01-31 09:59:32.126000000"
     }
    ]
@@ -88,7 +88,7 @@
     "checker_uuid": "test:my-checker",
     "state": "NOT_STARTED",
     "url": "https://foo.corp.com/test-checker/results/123",
-    "created": "2019-01-31 09:59:32.126000000"
+    "created": "2019-01-31 09:59:32.126000000",
     "updated": "2019-01-31 09:59:32.126000000"
   }
 ```
@@ -114,7 +114,7 @@
     "checker_uuid": "test:my-checker",
     "state": "RUNNING",
     "url": "https://foo.corp.com/test-checker/results/123",
-    "started": "2019-01-31 09:59:32.126000000",
+    "started": "2019-01-31 09:59:32.126000000"
   }
 ```
 
@@ -136,7 +136,7 @@
     "state": "RUNNING",
     "url": "https://foo.corp.com/test-checker/results/123",
     "started": "2019-01-31 09:59:32.126000000",
-    "created": "2019-01-31 09:59:32.126000000"
+    "created": "2019-01-31 09:59:32.126000000",
     "updated": "2019-01-31 09:59:32.126000000"
   }
 ```
diff --git a/resources/Documentation/rest-api-pending-checks.md b/resources/Documentation/rest-api-pending-checks.md
index 2974410..3a2ccd8 100644
--- a/resources/Documentation/rest-api-pending-checks.md
+++ b/resources/Documentation/rest-api-pending-checks.md
@@ -62,11 +62,11 @@
       "patch_set": {
         "repository": "test-repo",
         "change_number": 1,
-        "patch_set_id": 1,
+        "patch_set_id": 1
       }
       "pending_checks": {
         "test:my-checker": {
-          "state": "NOT_STARTED",
+          "state": "NOT_STARTED"
         }
       }
     },
@@ -74,11 +74,11 @@
       "patch_set": {
         "repository": "test-repo",
         "change_number": 5,
-        "patch_set_id": 2,
+        "patch_set_id": 2
       }
       "pending_checks": {
         "test:my-checker": {
-          "state": "SCHEDULED",
+          "state": "SCHEDULED"
         }
       }
     }