Use new APIs introduced in stable-3.5

* AuthRequest introduced a Factory
* GitRepositoryManager requires the implementation of
"Status getRepositoryStatus(Project.NameKey name)"

Bug: Issue 15232
Change-Id: I78987d61b2acf929da9c8f3ef31413475cbcdde5
diff --git a/src/main/java/com/googlesource/gerrit/plugins/healthcheck/check/AuthHealthCheck.java b/src/main/java/com/googlesource/gerrit/plugins/healthcheck/check/AuthHealthCheck.java
index ce9f8d9..c2b0f3e 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/healthcheck/check/AuthHealthCheck.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/healthcheck/check/AuthHealthCheck.java
@@ -36,6 +36,7 @@
   private final AccountCache byIdCache;
   private final String username;
   private final String password;
+  private final AuthRequest.Factory authRequestFactory;
 
   @Inject
   public AuthHealthCheck(
@@ -43,6 +44,7 @@
       HealthCheckConfig config,
       Realm realm,
       AccountCache byIdCache,
+      AuthRequest.Factory authRequestFactory,
       HealthCheckMetrics.Factory healthCheckMetricsFactory) {
     super(executor, config, AUTH, healthCheckMetricsFactory);
 
@@ -50,11 +52,12 @@
     this.byIdCache = byIdCache;
     this.username = config.getUsername(AUTH);
     this.password = config.getPassword(AUTH);
+    this.authRequestFactory = authRequestFactory;
   }
 
   @Override
   protected Result doCheck() throws Exception {
-    AuthRequest authRequest = AuthRequest.forUser(username);
+    AuthRequest authRequest = authRequestFactory.createForUser(username);
     authRequest.setPassword(password);
     realm.authenticate(authRequest);
 
diff --git a/src/test/java/com/googlesource/gerrit/plugins/healthcheck/JGitHealthCheckTest.java b/src/test/java/com/googlesource/gerrit/plugins/healthcheck/JGitHealthCheckTest.java
index 3c0adae..72259a5 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/healthcheck/JGitHealthCheckTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/healthcheck/JGitHealthCheckTest.java
@@ -102,6 +102,11 @@
     return new GitRepositoryManager() {
 
       @Override
+      public Status getRepositoryStatus(Project.NameKey name) {
+        return Status.ACTIVE;
+      }
+
+      @Override
       public Repository openRepository(Project.NameKey name)
           throws RepositoryNotFoundException, IOException {
         throw new RepositoryNotFoundException("Can't find repository " + name);