You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2023/10/11 18:51:03 UTC

[camel-quarkus] branch main updated: Sql: Test SqlTest#testDefaultErrorCode fails with mssql

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

jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


The following commit(s) were added to refs/heads/main by this push:
     new 49852bc9d0 Sql: Test SqlTest#testDefaultErrorCode fails with mssql
49852bc9d0 is described below

commit 49852bc9d042baf38adb549e5f942963e9f0ee17
Author: JiriOndrusek <on...@gmail.com>
AuthorDate: Mon Oct 9 11:51:23 2023 +0200

    Sql: Test SqlTest#testDefaultErrorCode fails with mssql
---
 .../org/apache/camel/quarkus/component/sql/it/SqlResource.java   | 7 +++++++
 .../java/org/apache/camel/quarkus/component/sql/it/SqlTest.java  | 9 ++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/integration-tests/sql/src/main/java/org/apache/camel/quarkus/component/sql/it/SqlResource.java b/integration-tests/sql/src/main/java/org/apache/camel/quarkus/component/sql/it/SqlResource.java
index 5eace4f388..36849c2477 100644
--- a/integration-tests/sql/src/main/java/org/apache/camel/quarkus/component/sql/it/SqlResource.java
+++ b/integration-tests/sql/src/main/java/org/apache/camel/quarkus/component/sql/it/SqlResource.java
@@ -205,4 +205,11 @@ public class SqlResource {
         }
     }
 
+    @Path("/dbKind")
+    @GET
+    @Produces(MediaType.APPLICATION_JSON)
+    public String getDbKind() {
+        return dbKind;
+    }
+
 }
diff --git a/integration-tests/sql/src/test/java/org/apache/camel/quarkus/component/sql/it/SqlTest.java b/integration-tests/sql/src/test/java/org/apache/camel/quarkus/component/sql/it/SqlTest.java
index 80c442645f..9db910560d 100644
--- a/integration-tests/sql/src/test/java/org/apache/camel/quarkus/component/sql/it/SqlTest.java
+++ b/integration-tests/sql/src/test/java/org/apache/camel/quarkus/component/sql/it/SqlTest.java
@@ -153,9 +153,16 @@ class SqlTest {
 
     @Test
     public void testDefaultErrorCode() throws InterruptedException {
+        String dbKind = RestAssured
+                .get("/sql/dbKind")
+                .then()
+                .statusCode(200)
+                .extract().asString();
         postMap("/sql/toDirect/transacted", CollectionHelper.mapOf(SqlConstants.SQL_QUERY, "select * from NOT_EXIST"))
                 .statusCode(200)
-                .body(startsWith("org.springframework.jdbc.BadSqlGrammarException"));
+                //SQLExceptionSubclassTranslator does not transalate mssql error - https://github.com/apache/camel-quarkus/issues/5411
+                .body("mssql".equals(dbKind) ? containsString("Invalid object name 'NOT_EXIST'")
+                        : startsWith("org.springframework.jdbc.BadSqlGrammarException"));
     }
 
     @Test