This is an automated email from the ASF dual-hosted git repository.

lizhimins pushed a commit to branch rocketmq-studio
in repository https://gitbox.apache.org/repos/asf/rocketmq-dashboard.git


The following commit(s) were added to refs/heads/rocketmq-studio by this push:
     new 10d8d95e test(ai): normalize YAML fixture line endings (#1705)
10d8d95e is described below

commit 10d8d95e6dd55f0f9dcf7d26a60669b040669915
Author: youngkermit8-coder <[email protected]>
AuthorDate: Tue Aug 11 20:51:19 2026 +0800

    test(ai): normalize YAML fixture line endings (#1705)
    
    Signed-off-by: youngkermit8-coder <[email protected]>
---
 .../studio/ops/ai/tool/ToolGatewayServiceTest.java | 31 +++++++++-------------
 1 file changed, 13 insertions(+), 18 deletions(-)

diff --git 
a/server/src/test/java/org/apache/rocketmq/studio/ops/ai/tool/ToolGatewayServiceTest.java
 
b/server/src/test/java/org/apache/rocketmq/studio/ops/ai/tool/ToolGatewayServiceTest.java
index 593ccec9..e3fc309a 100644
--- 
a/server/src/test/java/org/apache/rocketmq/studio/ops/ai/tool/ToolGatewayServiceTest.java
+++ 
b/server/src/test/java/org/apache/rocketmq/studio/ops/ai/tool/ToolGatewayServiceTest.java
@@ -515,15 +515,12 @@ class ToolGatewayServiceTest {
     @Test
     void failsStartupWhenToolSchemaContainsAnUnresolvedReference() throws 
IOException {
         String yaml = canonicalCatalogText().replace(
-                """
-                            inputSchema:
-                              type: object
-                              additionalProperties: false
-                        """,
-                """
-                            inputSchema:
-                              $ref: '#/missing'
-                        """);
+                "    inputSchema:\n"
+                        + "      type: object\n"
+                        + "      additionalProperties: false\n",
+                "    inputSchema:\n"
+                        + "      $ref: '#/missing'\n");
+        assertThat(yaml).contains("$ref: '#/missing'");
         ToolCatalog invalidCatalog = ToolCatalog.load(
                 new ByteArrayResource(yaml.getBytes(StandardCharsets.UTF_8)),
                 new ClassPathResource("tool-catalog/rmq-tools.schema.json"));
@@ -545,14 +542,11 @@ class ToolGatewayServiceTest {
     @Test
     void failsStartupWhenToolSchemaViolatesTheJsonSchemaMetaSchema() throws 
IOException {
         String yaml = canonicalCatalogText().replace(
-                """
-                            inputSchema:
-                              type: object
-                        """,
-                """
-                            inputSchema:
-                              type: unsupported
-                        """);
+                "    inputSchema:\n"
+                        + "      type: object\n",
+                "    inputSchema:\n"
+                        + "      type: unsupported\n");
+        assertThat(yaml).contains("type: unsupported");
         ToolCatalog invalidCatalog = ToolCatalog.load(
                 new ByteArrayResource(yaml.getBytes(StandardCharsets.UTF_8)),
                 new ClassPathResource("tool-catalog/rmq-tools.schema.json"));
@@ -615,7 +609,8 @@ class ToolGatewayServiceTest {
 
     private static String canonicalCatalogText() throws IOException {
         return new ClassPathResource("tool-catalog/rmq-tools.yaml")
-                .getContentAsString(StandardCharsets.UTF_8);
+                .getContentAsString(StandardCharsets.UTF_8)
+                .replace("\r\n", "\n");
     }
 
     private static ClusterVO cluster(ClusterType type) {

Reply via email to