diff --git a/WORKSPACE b/WORKSPACE
index 3897f81..7610ede 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -3,7 +3,7 @@
 load("//:bazlets.bzl", "load_bazlets")
 
 load_bazlets(
-    commit = "2c39029a585bd1d5b785150948f162730f7b7e42",
+    commit = "ca34f0cf89b2e041ea7f4aa4b9696efc2d76746f",
     #local_path = "/home/<user>/projects/bazlets",
 )
 
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 d7193fd..99fe80c 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
@@ -28,7 +28,6 @@
 import com.google.gerrit.server.events.ChangeMergedEvent;
 import com.google.gerrit.server.events.ChangeRestoredEvent;
 import com.google.gerrit.server.events.CommentAddedEvent;
-import com.google.gerrit.server.events.DraftPublishedEvent;
 import com.google.gerrit.server.events.Event;
 import com.google.gerrit.server.events.PatchSetCreatedEvent;
 import com.google.gerrit.server.events.RefUpdatedEvent;
@@ -93,9 +92,6 @@
     } else if (event instanceof ChangeRestoredEvent) {
       ChangeRestoredEvent e = (ChangeRestoredEvent) event;
       return isEnabled(e.getProjectNameKey(), e.getRefName());
-    } else if (event instanceof DraftPublishedEvent) {
-      DraftPublishedEvent e = (DraftPublishedEvent) event;
-      return isEnabled(e.getProjectNameKey(), e.getRefName());
     } else if (event instanceof RefUpdatedEvent) {
       RefUpdatedEvent e = (RefUpdatedEvent) event;
       return isEnabled(e.getProjectNameKey(), e.getRefName());
diff --git a/src/main/java/com/googlesource/gerrit/plugins/its/base/util/IssueExtractor.java b/src/main/java/com/googlesource/gerrit/plugins/its/base/util/IssueExtractor.java
index 572cffd..17f83c8 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/its/base/util/IssueExtractor.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/its/base/util/IssueExtractor.java
@@ -3,11 +3,16 @@
 import com.google.common.base.Strings;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
+import com.google.gerrit.extensions.api.GerritApi;
+import com.google.gerrit.extensions.client.ListChangesOption;
+import com.google.gerrit.extensions.common.ChangeInfo;
+import com.google.gerrit.extensions.common.RevisionInfo;
+import com.google.gerrit.extensions.restapi.RestApiException;
 import com.google.gerrit.reviewdb.client.PatchSet;
-import com.google.gerrit.reviewdb.server.ReviewDb;
-import com.google.gwtorm.server.OrmException;
+import com.google.inject.ImplementedBy;
 import com.google.inject.Inject;
 import com.googlesource.gerrit.plugins.its.base.its.ItsConfig;
+import java.util.EnumSet;
 import java.util.Map;
 import java.util.Set;
 import java.util.regex.Matcher;
@@ -20,11 +25,45 @@
   private static final Logger log = LoggerFactory.getLogger(IssueExtractor.class);
 
   private final CommitMessageFetcher commitMessageFetcher;
-  private final ReviewDb db;
+  private final PatchSetDb db;
   private final ItsConfig itsConfig;
 
+  @ImplementedBy(PatchSetDbImpl.class)
+  public interface PatchSetDb {
+    public String getRevision(PatchSet.Id patchSetId);
+  }
+
+  public static class PatchSetDbImpl implements PatchSetDb {
+    private final GerritApi gApi;
+
+    @Inject
+    public PatchSetDbImpl(GerritApi gApi) {
+      this.gApi = gApi;
+    }
+
+    @Override
+    public String getRevision(PatchSet.Id patchSetId) {
+      try {
+        ChangeInfo info =
+            gApi.changes()
+                .id(patchSetId.getParentKey().get())
+                .get(EnumSet.of(ListChangesOption.ALL_REVISIONS));
+        for (Map.Entry<String, RevisionInfo> e : info.revisions.entrySet()) {
+          if (e.getValue()._number == patchSetId.get()) {
+            return e.getKey();
+          }
+        }
+        return null;
+      } catch (RestApiException e) {
+        // previous is still empty to indicate that there was no previous
+        // accessible patch set. We treat every occurrence as added.
+      }
+      return null;
+    }
+  }
+
   @Inject
-  IssueExtractor(ItsConfig itsConfig, CommitMessageFetcher commitMessageFetcher, ReviewDb db) {
+  IssueExtractor(ItsConfig itsConfig, CommitMessageFetcher commitMessageFetcher, PatchSetDb db) {
     this.commitMessageFetcher = commitMessageFetcher;
     this.db = db;
     this.itsConfig = itsConfig;
@@ -179,14 +218,9 @@
       if (patchSetId.get() != 1) {
         PatchSet.Id previousPatchSetId =
             new PatchSet.Id(patchSetId.getParentKey(), patchSetId.get() - 1);
-        try {
-          PatchSet previousPatchSet = db.patchSets().get(previousPatchSetId);
-          if (previousPatchSet != null) {
-            previous = getIssueIds(projectName, previousPatchSet.getRevision().get());
-          }
-        } catch (OrmException e) {
-          // previous is still empty to indicate that there was no previous
-          // accessible patch set. We treat every occurrence as added.
+        String previousPatchSet = db.getRevision(previousPatchSetId);
+        if (previousPatchSet != null) {
+          previous = getIssueIds(projectName, previousPatchSet);
         }
       }
 
diff --git a/src/main/java/com/googlesource/gerrit/plugins/its/base/util/PropertyAttributeExtractor.java b/src/main/java/com/googlesource/gerrit/plugins/its/base/util/PropertyAttributeExtractor.java
index 98c593a..3b95144 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/its/base/util/PropertyAttributeExtractor.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/its/base/util/PropertyAttributeExtractor.java
@@ -113,10 +113,6 @@
         propertyFactory.create("deletions", Integer.toString(patchSetAttribute.sizeDeletions)));
     properties.add(
         propertyFactory.create("insertions", Integer.toString(patchSetAttribute.sizeInsertions)));
-    // deprecated, to be removed soon. migrate to ones without dash.
-    properties.add(propertyFactory.create("is-draft", Boolean.toString(patchSetAttribute.isDraft)));
-    // New style configs for vm and soy
-    properties.add(propertyFactory.create("isDraft", Boolean.toString(patchSetAttribute.isDraft)));
     properties.addAll(extractFrom(patchSetAttribute.uploader, "uploader"));
     properties.addAll(extractFrom(patchSetAttribute.author, "author"));
     return properties;
diff --git a/src/main/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractor.java b/src/main/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractor.java
index 16519de..f24eec4 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractor.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractor.java
@@ -27,7 +27,6 @@
 import com.google.gerrit.server.events.ChangeMergedEvent;
 import com.google.gerrit.server.events.ChangeRestoredEvent;
 import com.google.gerrit.server.events.CommentAddedEvent;
-import com.google.gerrit.server.events.DraftPublishedEvent;
 import com.google.gerrit.server.events.Event;
 import com.google.gerrit.server.events.PatchSetCreatedEvent;
 import com.google.gerrit.server.events.PatchSetEvent;
@@ -101,11 +100,6 @@
     return extractFrom((PatchSetEvent) event, common);
   }
 
-  private Map<String, Set<String>> extractFrom(DraftPublishedEvent event, Set<Property> common) {
-    common.addAll(propertyAttributeExtractor.extractFrom(event.uploader.get(), "uploader"));
-    return extractFrom((PatchSetEvent) event, common);
-  }
-
   private Map<String, Set<String>> extractFrom(RefUpdatedEvent event, Set<Property> common) {
     common.add(propertyFactory.create("event-type", event.type));
     if (event.submitter != null) {
@@ -190,8 +184,6 @@
       associations = extractFrom((ChangeRestoredEvent) event, common);
     } else if (event instanceof CommentAddedEvent) {
       associations = extractFrom((CommentAddedEvent) event, common);
-    } else if (event instanceof DraftPublishedEvent) {
-      associations = extractFrom((DraftPublishedEvent) event, common);
     } else if (event instanceof PatchSetCreatedEvent) {
       associations = extractFrom((PatchSetCreatedEvent) event, common);
     } else if (event instanceof RefUpdatedEvent) {
diff --git a/src/main/java/com/googlesource/gerrit/plugins/its/base/workflow/action/AddStandardComment.java b/src/main/java/com/googlesource/gerrit/plugins/its/base/workflow/action/AddStandardComment.java
index 8a7a09f..eb8c4a6 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/its/base/workflow/action/AddStandardComment.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/its/base/workflow/action/AddStandardComment.java
@@ -41,6 +41,16 @@
     this.its = its;
   }
 
+  private String formatPerson(String prefix, Map<String, String> map) {
+    String ret = Strings.nullToEmpty(map.get(prefix + "-name"));
+    ret = Strings.nullToEmpty(map.get(prefix + "Name"));
+    if (ret.isEmpty()) {
+      ret = Strings.nullToEmpty(map.get(prefix + "-username"));
+      ret = Strings.nullToEmpty(map.get(prefix + "Username"));
+    }
+    return ret;
+  }
+
   private String getCommentChangeEvent(String action, String prefix, Map<String, String> map) {
     String ret = "";
     String changeNumber = getValueFromMap(map, "", "change-number", "changeNumber");
diff --git a/src/main/resources/Documentation/config-rulebase-common.md b/src/main/resources/Documentation/config-rulebase-common.md
index 8f1da31..16f2de5 100644
--- a/src/main/resources/Documentation/config-rulebase-common.md
+++ b/src/main/resources/Documentation/config-rulebase-common.md
@@ -160,7 +160,6 @@
 * [ChangeMergedEvent][event-properties-ChangeMergedEvent]
 * [ChangeRestoredEvent][event-properties-ChangeRestoredEvent]
 * [CommentAddedEvent][event-properties-CommentAddedEvent]
-* [DraftPublishedEvent][event-properties-DraftPublishedEvent]
 * [PatchSetCreatedEvent][event-properties-PatchSetCreatedEvent]
 * [RefUpdatedEvent][event-properties-RefUpdatedEvent]
 * [Common properties for events on a change][event-properties-change]
@@ -332,19 +331,6 @@
 properties for the [Change][event-properties-change] the comment was
 added for, and it's most recent [Patch Set][event-properties-patch-set].
 
-[event-properties-DraftPublishedEvent]: #event-properties-DraftPublishedEvent
-### <a name="event-properties-DraftPublishedEvent">DraftPublishedEvent</a>
-
-`event`
-: `com.google.gerrit.server.events.DraftPublishedEvent`
-
-`event-type`
-: `draft-published`
-
-In addition to the above properties, the event also provides
-properties for the uploaded [Patch Set][event-properties-patch-set],
-and the [Change][event-properties-change] it belongs to.
-
 [event-properties-PatchSetCreatedEvent]: #event-properties-PatchSetCreatedEvent
 ### <a name="event-properties-PatchSetCreatedEvent">PatchSetCreatedEvent</a>
 
@@ -426,8 +412,8 @@
 : full commit message of the most recent patch set
 
 `status`
-:   status of the change (`null`, `NEW`, `SUBMITTED`, `DRAFT`, `MERGED`,
-    or `ABANDONED` )
+:	status of the change (`null`, `NEW`, `SUBMITTED`, `MERGED`,
+	or `ABANDONED` )
 
 `topic`
 : name of the topic the change belongs to.
@@ -453,9 +439,6 @@
 `insertions`
 : number of lines inserted by the patch set.
 
-`isDraft`
-: 'true', if the patch set is a draft patch set, 'false' otherwise.
-
 `parents`
 : A list of git commit hashes that are parents to the patch set.
 
diff --git a/src/test/java/com/googlesource/gerrit/plugins/its/base/its/ItsConfigTest.java b/src/test/java/com/googlesource/gerrit/plugins/its/base/its/ItsConfigTest.java
index 8f349b3..6561d00 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/its/base/its/ItsConfigTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/its/base/its/ItsConfigTest.java
@@ -28,7 +28,6 @@
 import com.google.gerrit.server.events.ChangeMergedEvent;
 import com.google.gerrit.server.events.ChangeRestoredEvent;
 import com.google.gerrit.server.events.CommentAddedEvent;
-import com.google.gerrit.server.events.DraftPublishedEvent;
 import com.google.gerrit.server.events.Event;
 import com.google.gerrit.server.events.PatchSetCreatedEvent;
 import com.google.gerrit.server.events.RefUpdatedEvent;
@@ -452,19 +451,6 @@
     assertTrue(itsConfig.isEnabled(event));
   }
 
-  public void testIsEnabledDraftPublishedEvent() {
-    String[] branches = {};
-    setupIsEnabled("true", null, branches);
-
-    DraftPublishedEvent event = new DraftPublishedEvent(testChange("testProject", "testBranch"));
-
-    ItsConfig itsConfig = createItsConfig();
-
-    replayMocks();
-
-    assertTrue(itsConfig.isEnabled(event));
-  }
-
   public void testIsEnabledRefUpdatedEvent() {
     String[] branches = {};
     setupIsEnabled("true", null, branches);
diff --git a/src/test/java/com/googlesource/gerrit/plugins/its/base/util/IssueExtractorTest.java b/src/test/java/com/googlesource/gerrit/plugins/its/base/util/IssueExtractorTest.java
index 2c61666..80cbfd3 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/its/base/util/IssueExtractorTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/its/base/util/IssueExtractorTest.java
@@ -21,13 +21,11 @@
 import com.google.gerrit.reviewdb.client.Change;
 import com.google.gerrit.reviewdb.client.PatchSet;
 import com.google.gerrit.reviewdb.client.RevId;
-import com.google.gerrit.reviewdb.server.PatchSetAccess;
-import com.google.gerrit.reviewdb.server.ReviewDb;
-import com.google.gwtorm.server.OrmException;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.googlesource.gerrit.plugins.its.base.its.ItsConfig;
 import com.googlesource.gerrit.plugins.its.base.testutil.LoggingMockingTestCase;
+import com.googlesource.gerrit.plugins.its.base.util.IssueExtractor.PatchSetDb;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
@@ -43,7 +41,7 @@
   private Injector injector;
   private ItsConfig itsConfig;
   private CommitMessageFetcher commitMessageFetcher;
-  private ReviewDb db;
+  private PatchSetDb db;
 
   public void testIssueIdsNullPattern() {
     IssueExtractor issueExtractor = injector.getInstance(IssueExtractor.class);
@@ -803,7 +801,7 @@
     assertLogMessageContains("Matching");
   }
 
-  public void testIssueIdsCommitWAddedSingleSubjectIssueSecondEmpty() throws OrmException {
+  public void testIssueIdsCommitWAddedSingleSubjectIssueSecondEmpty() {
     expect(itsConfig.getIssuePattern()).andReturn(Pattern.compile("bug#(\\d+)")).atLeastOnce();
     expect(itsConfig.getIssuePatternGroupIndex()).andReturn(1).atLeastOnce();
 
@@ -817,22 +815,14 @@
 
     // Call for previous patch set
     PatchSet.Id previousPatchSetId = new PatchSet.Id(changeId, 1);
-    RevId previousRevId = createMock(RevId.class);
-    expect(previousRevId.get()).andReturn("9876543211987654321298765432139876543214").anyTimes();
-
-    PatchSet previousPatchSet = createMock(PatchSet.class);
-    expect(previousPatchSet.getRevision()).andReturn(previousRevId).anyTimes();
-
-    PatchSetAccess patchSetAccess = createMock(PatchSetAccess.class);
-    expect(patchSetAccess.get(previousPatchSetId)).andReturn(previousPatchSet);
+    expect(db.getRevision(previousPatchSetId))
+        .andReturn("9876543211987654321298765432139876543214");
 
     expect(
             commitMessageFetcher.fetchGuarded(
                 "testProject", "9876543211987654321298765432139876543214"))
         .andReturn("subject\n" + "\n" + "Change-Id: I9876543211987654321298765432139876543214");
 
-    expect(db.patchSets()).andReturn(patchSetAccess);
-
     PatchSet.Id currentPatchSetId = createMock(PatchSet.Id.class);
     expect(currentPatchSetId.get()).andReturn(2).anyTimes();
     expect(currentPatchSetId.getParentKey()).andReturn(changeId).anyTimes();
@@ -860,7 +850,7 @@
     assertLogMessageContains("Matching");
   }
 
-  public void testIssueIdsCommitWAddedSingleSubjectIssueSecondSame() throws OrmException {
+  public void testIssueIdsCommitWAddedSingleSubjectIssueSecondSame() {
     expect(itsConfig.getIssuePattern()).andReturn(Pattern.compile("bug#(\\d+)")).atLeastOnce();
     expect(itsConfig.getIssuePatternGroupIndex()).andReturn(1).atLeastOnce();
 
@@ -874,21 +864,13 @@
 
     // Call for previous patch set
     PatchSet.Id previousPatchSetId = new PatchSet.Id(changeId, 1);
-    RevId previousRevId = createMock(RevId.class);
-    expect(previousRevId.get()).andReturn("9876543211987654321298765432139876543214").anyTimes();
-
-    PatchSet previousPatchSet = createMock(PatchSet.class);
-    expect(previousPatchSet.getRevision()).andReturn(previousRevId).anyTimes();
-
-    PatchSetAccess patchSetAccess = createMock(PatchSetAccess.class);
-    expect(patchSetAccess.get(previousPatchSetId)).andReturn(previousPatchSet);
-
     expect(
             commitMessageFetcher.fetchGuarded(
                 "testProject", "9876543211987654321298765432139876543214"))
         .andReturn("bug#42\n" + "\n" + "Change-Id: I9876543211987654321298765432139876543214");
 
-    expect(db.patchSets()).andReturn(patchSetAccess);
+    expect(db.getRevision(previousPatchSetId))
+        .andReturn("9876543211987654321298765432139876543214");
 
     PatchSet.Id currentPatchSetId = createMock(PatchSet.Id.class);
     expect(currentPatchSetId.get()).andReturn(2).anyTimes();
@@ -917,7 +899,7 @@
     assertLogMessageContains("Matching");
   }
 
-  public void testIssueIdsCommitWAddedSingleSubjectIssueSecondBody() throws OrmException {
+  public void testIssueIdsCommitWAddedSingleSubjectIssueSecondBody() {
     expect(itsConfig.getIssuePattern()).andReturn(Pattern.compile("bug#(\\d+)")).atLeastOnce();
     expect(itsConfig.getIssuePatternGroupIndex()).andReturn(1).atLeastOnce();
 
@@ -931,15 +913,6 @@
 
     // Call for previous patch set
     PatchSet.Id previousPatchSetId = new PatchSet.Id(changeId, 1);
-    RevId previousRevId = createMock(RevId.class);
-    expect(previousRevId.get()).andReturn("9876543211987654321298765432139876543214").anyTimes();
-
-    PatchSet previousPatchSet = createMock(PatchSet.class);
-    expect(previousPatchSet.getRevision()).andReturn(previousRevId).anyTimes();
-
-    PatchSetAccess patchSetAccess = createMock(PatchSetAccess.class);
-    expect(patchSetAccess.get(previousPatchSetId)).andReturn(previousPatchSet);
-
     expect(
             commitMessageFetcher.fetchGuarded(
                 "testProject", "9876543211987654321298765432139876543214"))
@@ -949,7 +922,8 @@
                 + "\n"
                 + "Change-Id: I9876543211987654321298765432139876543214");
 
-    expect(db.patchSets()).andReturn(patchSetAccess);
+    expect(db.getRevision(previousPatchSetId))
+        .andReturn("9876543211987654321298765432139876543214");
 
     PatchSet.Id currentPatchSetId = createMock(PatchSet.Id.class);
     expect(currentPatchSetId.get()).andReturn(2).anyTimes();
@@ -978,7 +952,7 @@
     assertLogMessageContains("Matching");
   }
 
-  public void testIssueIdsCommitWAddedSingleSubjectIssueSecondFooter() throws OrmException {
+  public void testIssueIdsCommitWAddedSingleSubjectIssueSecondFooter() {
     expect(itsConfig.getIssuePattern()).andReturn(Pattern.compile("bug#(\\d+)")).atLeastOnce();
     expect(itsConfig.getIssuePatternGroupIndex()).andReturn(1).atLeastOnce();
 
@@ -996,21 +970,13 @@
 
     // Call for previous patch set
     PatchSet.Id previousPatchSetId = new PatchSet.Id(changeId, 1);
-    RevId previousRevId = createMock(RevId.class);
-    expect(previousRevId.get()).andReturn("9876543211987654321298765432139876543214").anyTimes();
-
-    PatchSet previousPatchSet = createMock(PatchSet.class);
-    expect(previousPatchSet.getRevision()).andReturn(previousRevId).anyTimes();
-
-    PatchSetAccess patchSetAccess = createMock(PatchSetAccess.class);
-    expect(patchSetAccess.get(previousPatchSetId)).andReturn(previousPatchSet);
-
     expect(
             commitMessageFetcher.fetchGuarded(
                 "testProject", "9876543211987654321298765432139876543214"))
         .andReturn("bug#42\n" + "\n" + "Change-Id: I9876543211987654321298765432139876543214");
 
-    expect(db.patchSets()).andReturn(patchSetAccess);
+    expect(db.getRevision(previousPatchSetId))
+        .andReturn("9876543211987654321298765432139876543214");
 
     PatchSet.Id currentPatchSetId = createMock(PatchSet.Id.class);
     expect(currentPatchSetId.get()).andReturn(2).anyTimes();
@@ -1042,7 +1008,7 @@
     assertLogMessageContains("Matching");
   }
 
-  public void testIssueIdsCommitWAddedSubjectFooter() throws OrmException {
+  public void testIssueIdsCommitWAddedSubjectFooter() {
     expect(itsConfig.getIssuePattern()).andReturn(Pattern.compile("bug#(\\d+)")).atLeastOnce();
     expect(itsConfig.getIssuePatternGroupIndex()).andReturn(1).atLeastOnce();
 
@@ -1062,15 +1028,6 @@
 
     // Call for previous patch set
     PatchSet.Id previousPatchSetId = new PatchSet.Id(changeId, 1);
-    RevId previousRevId = createMock(RevId.class);
-    expect(previousRevId.get()).andReturn("9876543211987654321298765432139876543214").anyTimes();
-
-    PatchSet previousPatchSet = createMock(PatchSet.class);
-    expect(previousPatchSet.getRevision()).andReturn(previousRevId).anyTimes();
-
-    PatchSetAccess patchSetAccess = createMock(PatchSetAccess.class);
-    expect(patchSetAccess.get(previousPatchSetId)).andReturn(previousPatchSet);
-
     expect(
             commitMessageFetcher.fetchGuarded(
                 "testProject", "9876543211987654321298765432139876543214"))
@@ -1080,7 +1037,8 @@
                 + "\n"
                 + "Change-Id: I9876543211987654321298765432139876543214");
 
-    expect(db.patchSets()).andReturn(patchSetAccess);
+    expect(db.getRevision(previousPatchSetId))
+        .andReturn("9876543211987654321298765432139876543214");
 
     PatchSet.Id currentPatchSetId = createMock(PatchSet.Id.class);
     expect(currentPatchSetId.get()).andReturn(2).anyTimes();
@@ -1120,7 +1078,7 @@
     assertLogMessageContains("Matching");
   }
 
-  public void testIssueIdsCommitWAddedMultiple() throws OrmException {
+  public void testIssueIdsCommitWAddedMultiple() {
     expect(itsConfig.getIssuePattern()).andReturn(Pattern.compile("bug#(\\d+)")).atLeastOnce();
     expect(itsConfig.getIssuePatternGroupIndex()).andReturn(1).atLeastOnce();
 
@@ -1140,15 +1098,6 @@
 
     // Call for previous patch set
     PatchSet.Id previousPatchSetId = new PatchSet.Id(changeId, 1);
-    RevId previousRevId = createMock(RevId.class);
-    expect(previousRevId.get()).andReturn("9876543211987654321298765432139876543214").anyTimes();
-
-    PatchSet previousPatchSet = createMock(PatchSet.class);
-    expect(previousPatchSet.getRevision()).andReturn(previousRevId).anyTimes();
-
-    PatchSetAccess patchSetAccess = createMock(PatchSetAccess.class);
-    expect(patchSetAccess.get(previousPatchSetId)).andReturn(previousPatchSet);
-
     expect(
             commitMessageFetcher.fetchGuarded(
                 "testProject", "9876543211987654321298765432139876543214"))
@@ -1159,7 +1108,8 @@
                 + "Bug: bug#16\n"
                 + "Change-Id: I9876543211987654321298765432139876543214");
 
-    expect(db.patchSets()).andReturn(patchSetAccess);
+    expect(db.getRevision(previousPatchSetId))
+        .andReturn("9876543211987654321298765432139876543214");
 
     PatchSet.Id currentPatchSetId = createMock(PatchSet.Id.class);
     expect(currentPatchSetId.get()).andReturn(2).anyTimes();
@@ -1217,8 +1167,8 @@
       commitMessageFetcher = createMock(CommitMessageFetcher.class);
       bind(CommitMessageFetcher.class).toInstance(commitMessageFetcher);
 
-      db = createMock(ReviewDb.class);
-      bind(ReviewDb.class).toInstance(db);
+      db = createMock(PatchSetDb.class);
+      bind(PatchSetDb.class).toInstance(db);
     }
   }
 }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/its/base/util/PropertyAttributeExtractorTest.java b/src/test/java/com/googlesource/gerrit/plugins/its/base/util/PropertyAttributeExtractorTest.java
index 0df6abb..69d8196 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/its/base/util/PropertyAttributeExtractorTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/its/base/util/PropertyAttributeExtractorTest.java
@@ -351,7 +351,6 @@
     patchSetAttribute.parents = Lists.newArrayList("parent1", "parent2");
     patchSetAttribute.sizeDeletions = 7;
     patchSetAttribute.sizeInsertions = 12;
-    patchSetAttribute.isDraft = true;
     patchSetAttribute.uploader = uploader;
     patchSetAttribute.author = author;
 
@@ -383,12 +382,6 @@
     Property propertyInsertions = createMock(Property.class);
     expect(propertyFactory.create("insertions", "12")).andReturn(propertyInsertions);
 
-    Property propertyIsDraft = createMock(Property.class);
-    expect(propertyFactory.create("is-draft", "true")).andReturn(propertyIsDraft);
-
-    Property propertyIsDraft2 = createMock(Property.class);
-    expect(propertyFactory.create("isDraft", "true")).andReturn(propertyIsDraft2);
-
     Property propertyUploaderEmail = createMock(Property.class);
     expect(propertyFactory.create("uploaderEmail", "testEmail1")).andReturn(propertyUploaderEmail);
 
@@ -446,8 +439,6 @@
     expected.add(propertyParents);
     expected.add(propertyDeletions);
     expected.add(propertyInsertions);
-    expected.add(propertyIsDraft);
-    expected.add(propertyIsDraft2);
     expected.add(propertyUploaderEmail);
     expected.add(propertyUploaderName);
     expected.add(propertyUploaderUsername);
diff --git a/src/test/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractorTest.java b/src/test/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractorTest.java
index 10cac7b..0b900c0 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractorTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractorTest.java
@@ -31,7 +31,6 @@
 import com.google.gerrit.server.events.ChangeMergedEvent;
 import com.google.gerrit.server.events.ChangeRestoredEvent;
 import com.google.gerrit.server.events.CommentAddedEvent;
-import com.google.gerrit.server.events.DraftPublishedEvent;
 import com.google.gerrit.server.events.Event;
 import com.google.gerrit.server.events.PatchSetCreatedEvent;
 import com.google.gerrit.server.events.RefUpdatedEvent;
@@ -271,40 +270,6 @@
     eventHelper(event, "CommentAddedEvent", "comment-added", common, true);
   }
 
-  public void testDraftPublishedEvent() {
-    DraftPublishedEvent event = new DraftPublishedEvent(testChange("testProject", "testBranch"));
-
-    ChangeAttribute changeAttribute = createMock(ChangeAttribute.class);
-    event.change = Suppliers.ofInstance(changeAttribute);
-    Property propertyChange = createMock(Property.class);
-    expect(propertyAttributeExtractor.extractFrom(changeAttribute))
-        .andReturn(Sets.newHashSet(propertyChange));
-
-    AccountAttribute accountAttribute = createMock(AccountAttribute.class);
-    event.uploader = Suppliers.ofInstance(accountAttribute);
-    Property propertySubmitter = createMock(Property.class);
-    expect(propertyAttributeExtractor.extractFrom(accountAttribute, "uploader"))
-        .andReturn(Sets.newHashSet(propertySubmitter));
-
-    PatchSetAttribute patchSetAttribute = createMock(PatchSetAttribute.class);
-    event.patchSet = Suppliers.ofInstance(patchSetAttribute);
-    Property propertyPatchSet = createMock(Property.class);
-    expect(propertyAttributeExtractor.extractFrom(patchSetAttribute))
-        .andReturn(Sets.newHashSet(propertyPatchSet));
-
-    changeAttribute.project = "testProject";
-    changeAttribute.number = 176;
-    patchSetAttribute.revision = "testRevision";
-    patchSetAttribute.number = 3;
-
-    Set<Property> common = Sets.newHashSet();
-    common.add(propertyChange);
-    common.add(propertySubmitter);
-    common.add(propertyPatchSet);
-
-    eventHelper(event, "DraftPublishedEvent", "draft-published", common, true);
-  }
-
   public void testPatchSetCreatedEvent() {
     PatchSetCreatedEvent event = new PatchSetCreatedEvent(testChange("testProject", "testBranch"));
 
