Fix hook configuration names to match documentation

Most hooks in the documentation are named with "Hook" suffix, but
in the code the "Hook" suffix was omitted. This prevented the hook
from being found when the administrator configured it with the
documented name.

Fix the values used, to match the documented values.

Also update the documentation to add the "Hook" suffix where it was
missing.

Bug: Issue 6508
Change-Id: Icdfdaaa2a4b89ed636e9165fc073234fb79abd2b
diff --git a/src/main/java/com/googlesource/gerrit/plugins/hooks/HashtagsEdited.java b/src/main/java/com/googlesource/gerrit/plugins/hooks/HashtagsEdited.java
index e781833..9bb40c1 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/hooks/HashtagsEdited.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/hooks/HashtagsEdited.java
@@ -27,7 +27,7 @@
 
   @Inject
   HashtagsEdited(HookFactory hookFactory) {
-    this.hook = hookFactory.createAsync("hashtagsChanged", "hashtags-changed");
+    this.hook = hookFactory.createAsync("hashtagsChangedHook", "hashtags-changed");
     this.hookFactory = hookFactory;
   }
 
diff --git a/src/main/java/com/googlesource/gerrit/plugins/hooks/NewProjectCreated.java b/src/main/java/com/googlesource/gerrit/plugins/hooks/NewProjectCreated.java
index eb566f8..5ff73f7 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/hooks/NewProjectCreated.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/hooks/NewProjectCreated.java
@@ -25,7 +25,7 @@
 
   @Inject
   NewProjectCreated(HookFactory hookFactory) {
-    this.hook = hookFactory.createAsync("projectCreated", "project-created");
+    this.hook = hookFactory.createAsync("projectCreatedHook", "project-created");
     this.hookFactory = hookFactory;
   }
 
diff --git a/src/main/java/com/googlesource/gerrit/plugins/hooks/ReviewerAdded.java b/src/main/java/com/googlesource/gerrit/plugins/hooks/ReviewerAdded.java
index ac0763a..fca527d 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/hooks/ReviewerAdded.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/hooks/ReviewerAdded.java
@@ -27,7 +27,7 @@
 
   @Inject
   ReviewerAdded(HookFactory hookFactory) {
-    this.hook = hookFactory.createAsync("reviewerAdded", "reviewer-added");
+    this.hook = hookFactory.createAsync("reviewerAddedHook", "reviewer-added");
     this.hookFactory = hookFactory;
   }
 
diff --git a/src/main/java/com/googlesource/gerrit/plugins/hooks/ReviewerDeleted.java b/src/main/java/com/googlesource/gerrit/plugins/hooks/ReviewerDeleted.java
index 5830e56..e23677d 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/hooks/ReviewerDeleted.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/hooks/ReviewerDeleted.java
@@ -26,7 +26,7 @@
 
   @Inject
   ReviewerDeleted(HookFactory hookFactory) {
-    this.hook = hookFactory.createAsync("reviewerDeleted", "reviewer-deleted");
+    this.hook = hookFactory.createAsync("reviewerDeletedHook", "reviewer-deleted");
     this.hookFactory = hookFactory;
   }
 
diff --git a/src/main/java/com/googlesource/gerrit/plugins/hooks/RevisionCreated.java b/src/main/java/com/googlesource/gerrit/plugins/hooks/RevisionCreated.java
index de275e5..cd4a9d1 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/hooks/RevisionCreated.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/hooks/RevisionCreated.java
@@ -26,7 +26,7 @@
 
   @Inject
   RevisionCreated(HookFactory hookFactory) {
-    this.hook = hookFactory.createAsync("patchsetCreated", "patchset-created");
+    this.hook = hookFactory.createAsync("patchsetCreatedHook", "patchset-created");
     this.hookFactory = hookFactory;
   }
 
diff --git a/src/main/java/com/googlesource/gerrit/plugins/hooks/TopicEdited.java b/src/main/java/com/googlesource/gerrit/plugins/hooks/TopicEdited.java
index a4b3608..e608694 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/hooks/TopicEdited.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/hooks/TopicEdited.java
@@ -26,7 +26,7 @@
 
   @Inject
   TopicEdited(HookFactory hookFactory) {
-    this.hook = hookFactory.createAsync("topicChanged", "topic-changed");
+    this.hook = hookFactory.createAsync("topicChangedHook", "topic-changed");
     this.hookFactory = hookFactory;
   }
 
diff --git a/src/main/resources/Documentation/config.md b/src/main/resources/Documentation/config.md
index afb26cf..432bcb8 100644
--- a/src/main/resources/Documentation/config.md
+++ b/src/main/resources/Documentation/config.md
@@ -44,7 +44,7 @@
 hooks.commentAddedHook
 :	Filename for the comment added hook. If not set, defaults to `comment-added`.
 
-hooks.commitReceived
+hooks.commitReceivedHook
 :	Filename for the commit received hook. If not set, defaults to `commit-received`.
 
 hooks.draftPublishedHook
@@ -59,7 +59,7 @@
 hooks.projectCreatedHook
 :	Filename for the project created hook. If not set, defaults to `project-created`.
 
-hooks.refUpdate
+hooks.refUpdateHook
 :	Filename for the ref update hook. If not set, defaults to `ref-update`.
 
 hooks.refUpdatedHook