This is an automated email from the ASF dual-hosted git repository.
jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 201510f02b validate swagger endpoints (#12750)
201510f02b is described below
commit 201510f02bd472b02c3e9148958021ffdcdf9987
Author: sullis <[email protected]>
AuthorDate: Wed Apr 3 21:49:15 2024 -0700
validate swagger endpoints (#12750)
---
.../tests/AdminConsoleIntegrationTest.java | 25 ++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git
a/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/AdminConsoleIntegrationTest.java
b/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/AdminConsoleIntegrationTest.java
index d0956b3d41..589fac4d7d 100644
---
a/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/AdminConsoleIntegrationTest.java
+++
b/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/AdminConsoleIntegrationTest.java
@@ -26,6 +26,7 @@ import org.apache.pinot.util.TestUtils;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
+import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
@@ -90,4 +91,28 @@ public class AdminConsoleIntegrationTest extends
BaseClusterIntegrationTest {
response = sendGetRequest(serverBaseApiUrl + "/api");
Assert.assertEquals(response, expected);
}
+
+ @Test(dataProvider = "endpointBase")
+ public void testSwaggerYaml(final String description, final String
endpointBase)
+ throws Exception {
+ String response = sendGetRequest(endpointBase + "/swagger.yaml");
+ Assert.assertTrue(response.startsWith("---\nswagger: \"2.0\""));
+ }
+
+ @Test(dataProvider = "endpointBase")
+ public void testSwaggerJson(final String description, final String
endpointBase)
+ throws Exception {
+ String response = sendGetRequest(endpointBase + "/swagger.json");
+ Assert.assertTrue(response.startsWith("{\"swagger\":\"2.0\""));
+ Assert.assertTrue(response.endsWith("}"));
+ }
+
+ @DataProvider
+ public Object[][] endpointBase() {
+ return new Object[][] {
+ new Object[] { "controller", getControllerBaseApiUrl() },
+ new Object[] { "broker", getBrokerBaseApiUrl() },
+ new Object[] { "server", "http://localhost:" + getServerAdminApiPort()
}
+ };
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]