Adapt to Gerrit core that changed the type of timestamp fields to Instant

Make the checks plugin build again.

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I59e85f88e7c86397fd14215d562216c2ef3608b4
diff --git a/java/com/google/gerrit/plugins/checks/Check.java b/java/com/google/gerrit/plugins/checks/Check.java
index 8cf130e..2d0863a 100644
--- a/java/com/google/gerrit/plugins/checks/Check.java
+++ b/java/com/google/gerrit/plugins/checks/Check.java
@@ -26,8 +26,8 @@
   public static Check newBackfilledCheck(Project.NameKey project, PatchSet ps, Checker checker) {
     return Check.builder(CheckKey.create(project, ps.id(), checker.getUuid()))
         .setState(CheckState.NOT_STARTED)
-        .setCreated(ps.createdOn())
-        .setUpdated(ps.createdOn())
+        .setCreated(Timestamp.from(ps.createdOn()))
+        .setUpdated(Timestamp.from(ps.createdOn()))
         .build();
   }
 
diff --git a/java/com/google/gerrit/plugins/checks/db/NoteDbCheckersUpdate.java b/java/com/google/gerrit/plugins/checks/db/NoteDbCheckersUpdate.java
index 72b01c2..e84e129 100644
--- a/java/com/google/gerrit/plugins/checks/db/NoteDbCheckersUpdate.java
+++ b/java/com/google/gerrit/plugins/checks/db/NoteDbCheckersUpdate.java
@@ -203,8 +203,7 @@
       PersonIdent authorIdent;
       if (currentUser.isPresent()) {
         metaDataUpdate.setAuthor(currentUser.get());
-        authorIdent =
-            currentUser.get().newCommitterIdent(serverIdent.getWhen(), serverIdent.getTimeZone());
+        authorIdent = currentUser.get().newCommitterIdent(serverIdent);
       } else {
         authorIdent = serverIdent;
       }
diff --git a/javatests/com/google/gerrit/plugins/checks/acceptance/CheckerRefsIT.java b/javatests/com/google/gerrit/plugins/checks/acceptance/CheckerRefsIT.java
index df918fa..e9cadf3 100644
--- a/javatests/com/google/gerrit/plugins/checks/acceptance/CheckerRefsIT.java
+++ b/javatests/com/google/gerrit/plugins/checks/acceptance/CheckerRefsIT.java
@@ -326,8 +326,7 @@
       ins.setValidate(false);
       ins.setMessage(String.format("Uploaded patch set %s.", ins.getPatchSetId().get()));
       try (BatchUpdate bu =
-          updateFactory.create(
-              project, identifiedUserFactory.create(admin.id()), TimeUtil.nowTs())) {
+          updateFactory.create(project, identifiedUserFactory.create(admin.id()), TimeUtil.now())) {
         bu.setRepository(git, rw, oi);
         bu.insertChange(ins);
         bu.execute();
diff --git a/javatests/com/google/gerrit/plugins/checks/rules/ChecksSubmitRuleTest.java b/javatests/com/google/gerrit/plugins/checks/rules/ChecksSubmitRuleTest.java
index affb4c6..43e39e7 100644
--- a/javatests/com/google/gerrit/plugins/checks/rules/ChecksSubmitRuleTest.java
+++ b/javatests/com/google/gerrit/plugins/checks/rules/ChecksSubmitRuleTest.java
@@ -66,7 +66,7 @@
                 .id(PatchSet.id(changeId, 1))
                 .commitId(ObjectId.zeroId())
                 .uploader(Account.id(1000))
-                .createdOn(TimeUtil.nowTs())
+                .createdOn(TimeUtil.now())
                 .build());
 
     Optional<SubmitRecord> submitRecords = checksSubmitRule.evaluate(cd);
@@ -90,7 +90,7 @@
                 .id(PatchSet.id(changeId, 1))
                 .commitId(ObjectId.zeroId())
                 .uploader(Account.id(1000))
-                .createdOn(TimeUtil.nowTs())
+                .createdOn(TimeUtil.now())
                 .build());
 
     Optional<SubmitRecord> submitRecord = checksSubmitRule.evaluate(cd);