From 40486fd76a49c9417e2f2834079c940063ed7b4b Mon Sep 17 00:00:00 2001
From: Martin Lowe <martin.lowe@eclipse-foundation.org>
Date: Wed, 4 Jan 2023 10:48:21 -0500
Subject: [PATCH] Update root-path to expose non-app endpoints for health check

---
 pom.xml                                       |  4 +-
 .../wg/resource/WorkingGroupsResource.java    |  2 +-
 src/main/resources/application.properties     |  2 +
 .../resource/WorkingGroupsResourceTest.java   | 72 ++++++++++---------
 4 files changed, 44 insertions(+), 36 deletions(-)

diff --git a/pom.xml b/pom.xml
index 1c1e897..5315c56 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,11 +12,11 @@
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
     <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
     <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
-    <quarkus.platform.version>2.6.3.Final</quarkus.platform.version>
+    <quarkus.platform.version>2.11.2.Final</quarkus.platform.version>
     <surefire-plugin.version>3.0.0-M5</surefire-plugin.version>
     <auto-value.version>1.8.2</auto-value.version>
     <hibernate.version>5.5.6.Final</hibernate.version>
-    <eclipse-api-version>0.6.5</eclipse-api-version>
+    <eclipse-api-version>0.6.10</eclipse-api-version>
     <fdndb-api-version>1.0-SNAPSHOT</fdndb-api-version>
   </properties>
   <repositories>
diff --git a/src/main/java/org/eclipsefoundation/wg/resource/WorkingGroupsResource.java b/src/main/java/org/eclipsefoundation/wg/resource/WorkingGroupsResource.java
index 83cd6a1..66efabd 100644
--- a/src/main/java/org/eclipsefoundation/wg/resource/WorkingGroupsResource.java
+++ b/src/main/java/org/eclipsefoundation/wg/resource/WorkingGroupsResource.java
@@ -34,7 +34,7 @@ import org.eclipsefoundation.wg.services.WorkingGroupsService;
  *
  * @author Martin Lowe, Zachary Sabourin
  */
-@Path("working-groups")
+@Path("")
 @Produces(MediaType.APPLICATION_JSON)
 @Consumes(MediaType.APPLICATION_JSON)
 public class WorkingGroupsResource {
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 3d46e6f..33e77b4 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -1,3 +1,5 @@
+quarkus.http.root-path=/working-groups
+
 fdndb-api/mp-rest/url=http://localhost:8095
 fdndb-api/mp-rest/scope=javax.inject.Singleton
 
diff --git a/src/test/java/org/eclipsefoundation/wg/resource/WorkingGroupsResourceTest.java b/src/test/java/org/eclipsefoundation/wg/resource/WorkingGroupsResourceTest.java
index 65ca90e..562197b 100644
--- a/src/test/java/org/eclipsefoundation/wg/resource/WorkingGroupsResourceTest.java
+++ b/src/test/java/org/eclipsefoundation/wg/resource/WorkingGroupsResourceTest.java
@@ -23,7 +23,7 @@ import io.restassured.http.ContentType;
 @QuarkusTest
 class WorkingGroupsResourceTest {
 
-    public final static String WGS_BASE_URL = "/working-groups";
+    public final static String WGS_BASE_URL = "";
 
     public final static String WG_STATUS_URL = WGS_BASE_URL + "?status={param}";
     public final static String WG_STATUSES_URL = WGS_BASE_URL + "?status={param1}&status={param2}";
@@ -37,65 +37,71 @@ class WorkingGroupsResourceTest {
     /*
      * GET_ALL
      */
-    public final static EndpointTestCase GET_ALL_SUCCESS = TestCaseHelper.buildSuccessCase(WGS_BASE_URL,
-            new String[] {}, SchemaNamespaceHelper.WORKING_GROUPS_SCHEMA_PATH);
+    public final static EndpointTestCase GET_ALL_SUCCESS = TestCaseHelper
+            .buildSuccessCase(WGS_BASE_URL, new String[] {}, SchemaNamespaceHelper.WORKING_GROUPS_SCHEMA_PATH);
 
-    public final static EndpointTestCase GET_ALL_INVALID_FORMAT = TestCaseHelper.buildInvalidFormatCase(WGS_BASE_URL,
-            new String[] {}, ContentType.TEXT);
+    public final static EndpointTestCase GET_ALL_INVALID_FORMAT = TestCaseHelper
+            .buildInvalidFormatCase(WGS_BASE_URL, new String[] {}, ContentType.TEXT);
 
-    public final static EndpointTestCase GET_ALL_SINGLE_STATUS_SUCCESS = TestCaseHelper.buildSuccessCase(WG_STATUS_URL,
-            new String[] { "active" }, SchemaNamespaceHelper.WORKING_GROUPS_SCHEMA_PATH);
+    public final static EndpointTestCase GET_ALL_SINGLE_STATUS_SUCCESS = TestCaseHelper
+            .buildSuccessCase(WG_STATUS_URL, new String[] { "active" },
+                    SchemaNamespaceHelper.WORKING_GROUPS_SCHEMA_PATH);
 
-    public final static EndpointTestCase GET_ALL_MULTI_STATUS_SUCCESS = TestCaseHelper.buildSuccessCase(WG_STATUSES_URL,
-            new String[] { "active", "archived" }, SchemaNamespaceHelper.WORKING_GROUPS_SCHEMA_PATH);
+    public final static EndpointTestCase GET_ALL_MULTI_STATUS_SUCCESS = TestCaseHelper
+            .buildSuccessCase(WG_STATUSES_URL, new String[] { "active", "archived" },
+                    SchemaNamespaceHelper.WORKING_GROUPS_SCHEMA_PATH);
 
     /*
      * GET_BY_ALIAS
      */
-    public final static EndpointTestCase GET_BY_ALIAS_SUCCESS = TestCaseHelper.buildSuccessCase(WG_BASE_URL,
-            new String[] { "awful-group" }, SchemaNamespaceHelper.WORKING_GROUP_SCHEMA_PATH);
+    public final static EndpointTestCase GET_BY_ALIAS_SUCCESS = TestCaseHelper
+            .buildSuccessCase(WG_BASE_URL, new String[] { "awful-group" },
+                    SchemaNamespaceHelper.WORKING_GROUP_SCHEMA_PATH);
 
-    public final static EndpointTestCase GET_BY_ALIAS_INVALID_ALIAS = TestCaseHelper.buildNotFoundCase(WG_BASE_URL,
-            new String[] { "invalid-Group" });
+    public final static EndpointTestCase GET_BY_ALIAS_INVALID_ALIAS = TestCaseHelper
+            .buildNotFoundCase(WG_BASE_URL, new String[] { "invalid-Group" }, null);
 
-    public final static EndpointTestCase GET_BY_ALIAS_INVALID_FORMAT = TestCaseHelper.buildInvalidFormatCase(
-            WG_BASE_URL, new String[] { "important-group" }, ContentType.TEXT);
+    public final static EndpointTestCase GET_BY_ALIAS_INVALID_FORMAT = TestCaseHelper
+            .buildInvalidFormatCase(WG_BASE_URL, new String[] { "important-group" }, ContentType.TEXT);
 
     /*
      * GET_RESOURCES
      */
-    public final static EndpointTestCase GET_RESOURCES_SUCCESS = TestCaseHelper.buildSuccessCase(WG_RESOURCES_URL,
-            new String[] { "important-group" }, SchemaNamespaceHelper.WORKING_GROUP_RESOURCES_SCHEMA_PATH);
+    public final static EndpointTestCase GET_RESOURCES_SUCCESS = TestCaseHelper
+            .buildSuccessCase(WG_RESOURCES_URL, new String[] { "important-group" },
+                    SchemaNamespaceHelper.WORKING_GROUP_RESOURCES_SCHEMA_PATH);
 
-    public final static EndpointTestCase GET_RESOURCES_INVALID_ALIAS = TestCaseHelper.buildNotFoundCase(
-            WG_RESOURCES_URL, new String[] { "invalid-Group" });
+    public final static EndpointTestCase GET_RESOURCES_INVALID_ALIAS = TestCaseHelper
+            .buildNotFoundCase(WG_RESOURCES_URL, new String[] { "invalid-Group" }, null);
 
-    public final static EndpointTestCase GET_RESOURCES_INVALID_FORMAT = TestCaseHelper.buildInvalidFormatCase(
-            WG_RESOURCES_URL, new String[] { "mediocre-group " }, ContentType.TEXT);
+    public final static EndpointTestCase GET_RESOURCES_INVALID_FORMAT = TestCaseHelper
+            .buildInvalidFormatCase(WG_RESOURCES_URL, new String[] { "mediocre-group " }, ContentType.TEXT);
 
     /*
      * GET_LEVELS
      */
-    public final static EndpointTestCase GET_LEVELS_SUCCESS = TestCaseHelper.buildSuccessCase(WG_LEVELS_URL,
-            new String[] { "mediocre-group" }, SchemaNamespaceHelper.WORKING_GROUP_LEVELS_SCHEMA_PATH);
+    public final static EndpointTestCase GET_LEVELS_SUCCESS = TestCaseHelper
+            .buildSuccessCase(WG_LEVELS_URL, new String[] { "mediocre-group" },
+                    SchemaNamespaceHelper.WORKING_GROUP_LEVELS_SCHEMA_PATH);
 
-    public final static EndpointTestCase GET_LEVELS_INVALID_ALIAS = TestCaseHelper.buildNotFoundCase(WG_LEVELS_URL,
-            new String[] { "invalid-Group" });
+    public final static EndpointTestCase GET_LEVELS_INVALID_ALIAS = TestCaseHelper
+            .buildNotFoundCase(WG_LEVELS_URL, new String[] { "invalid-Group" }, null);
 
-    public final static EndpointTestCase GET_LEVELS_INVALID_FORMAT = TestCaseHelper.buildInvalidFormatCase(
-            WG_LEVELS_URL, new String[] { "mediocre-group " }, ContentType.TEXT);
+    public final static EndpointTestCase GET_LEVELS_INVALID_FORMAT = TestCaseHelper
+            .buildInvalidFormatCase(WG_LEVELS_URL, new String[] { "mediocre-group " }, ContentType.TEXT);
 
     /*
      * GET_AGREEMENTS
      */
-    public final static EndpointTestCase GET_AGREEMENTS_SUCCESS = TestCaseHelper.buildSuccessCase(WG_AGREEMENTS_URL,
-            new String[] { "important-group" }, SchemaNamespaceHelper.WORKING_GROUP_AGREEMENT_SCHEMA_PATH);
+    public final static EndpointTestCase GET_AGREEMENTS_SUCCESS = TestCaseHelper
+            .buildSuccessCase(WG_AGREEMENTS_URL, new String[] { "important-group" },
+                    SchemaNamespaceHelper.WORKING_GROUP_AGREEMENT_SCHEMA_PATH);
 
-    public final static EndpointTestCase GET_AGREEMENTS_INVALID_ALIAS = TestCaseHelper.buildNotFoundCase(
-            WG_AGREEMENTS_URL, new String[] { "invalid-Group" });
+    public final static EndpointTestCase GET_AGREEMENTS_INVALID_ALIAS = TestCaseHelper
+            .buildNotFoundCase(WG_AGREEMENTS_URL, new String[] { "invalid-Group" }, null);
 
-    public final static EndpointTestCase GET_AGREEMENTS_INVALID_FORMAT = TestCaseHelper.buildInvalidFormatCase(
-            WG_AGREEMENTS_URL, new String[] { "important-group" }, ContentType.TEXT);
+    public final static EndpointTestCase GET_AGREEMENTS_INVALID_FORMAT = TestCaseHelper
+            .buildInvalidFormatCase(WG_AGREEMENTS_URL, new String[] { "important-group" }, ContentType.TEXT);
 
     @Test
     void getAll_success() {
-- 
GitLab