liucongjy commented on code in PR #9951:
URL: https://github.com/apache/seatunnel/pull/9951#discussion_r2443757029


##########
seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/rest/RestApiHttpsTest.java:
##########
@@ -126,4 +122,54 @@ public void testRestApiHttpsFailed() {
                     conn.getResponseCode();
                 });
     }
+
+    @Test
+    public void testFinishedJobsApi() throws Exception {
+        // pagination test
+        restApiRequestHttp(
+                "http://localhost:"; + HTTP_PORT + 
"/finished-jobs?page=1&rows=5",
+                response -> {
+                    JsonObject resultJson = (JsonObject) Json.parse(response);
+                    Assertions.assertTrue(
+                            resultJson.get("data") != null && 
resultJson.get("total") != null);
+                });
+        // no pagination test
+        restApiRequestHttp(
+                "http://localhost:"; + HTTP_PORT + "/finished-jobs",
+                response -> {
+                    JsonArray resultJson = (JsonArray) Json.parse(response);
+                    Assertions.assertTrue(resultJson != null);
+                });

Review Comment:
   Implemented validation checks for API return row counts and added unit tests 
to verify behavior when page numbers exceed available data.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to