From 72664f330a246196e082c4d0ea3ac93d444bee7b Mon Sep 17 00:00:00 2001 From: Guangdong Liu <804167098@qq.com> Date: Sun, 27 Oct 2024 18:10:09 +0800 Subject: [PATCH] [Improve][Rest api]add verifyHtmlResponse test case (#7919) --- .../seatunnel/engine/e2e/RestApiIT.java | 25 +++++++++++++++++++ .../src/test/resources/seatunnel.yaml | 3 +-- .../src/main/resources/seatunnel.yaml | 4 +-- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/RestApiIT.java b/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/RestApiIT.java index 4dd4a11b318..67be14a1f45 100644 --- a/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/RestApiIT.java +++ b/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/RestApiIT.java @@ -984,6 +984,31 @@ public void testGetThreadDump() { }); } + @Test + public void verifyHtmlResponseBasic() { + Arrays.asList(node2, node1) + .forEach( + instance -> { + ports.forEach( + (key, value) -> { + given().get( + HOST + + value + + node1Config + .getEngineConfig() + .getHttpConfig() + .getContextPath()) + .then() + .statusCode(200) + .contentType(containsString("text/html")) + .body(containsString("Seatunnel Engine UI")); + }); + }); + } + @AfterEach void afterClass() { if (engineClient != null) { diff --git a/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/resources/seatunnel.yaml b/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/resources/seatunnel.yaml index b89ede92b2c..a0f92cbbc72 100644 --- a/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/resources/seatunnel.yaml +++ b/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/resources/seatunnel.yaml @@ -33,5 +33,4 @@ seatunnel: namespace: /tmp/seatunnel/checkpoint_snapshot/ http: enable-http: false - port: 8080 - context-path: /seatunnel \ No newline at end of file + port: 8080 \ No newline at end of file diff --git a/seatunnel-engine/seatunnel-engine-common/src/main/resources/seatunnel.yaml b/seatunnel-engine/seatunnel-engine-common/src/main/resources/seatunnel.yaml index c9bb71ecc07..33acf185f1d 100644 --- a/seatunnel-engine/seatunnel-engine-common/src/main/resources/seatunnel.yaml +++ b/seatunnel-engine/seatunnel-engine-common/src/main/resources/seatunnel.yaml @@ -42,5 +42,5 @@ seatunnel: metric: enabled: false http: - port: 8080 - context-path: /seatunnel \ No newline at end of file + enable-http: true + port: 8080 \ No newline at end of file