You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zh...@apache.org on 2023/10/17 02:13:30 UTC
[camel-quarkus] branch 3.2.x updated: Sql: Test SqlTest#testDefaultErrorCode fails with mssql
This is an automated email from the ASF dual-hosted git repository.
zhfeng pushed a commit to branch 3.2.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/3.2.x by this push:
new 0f47355c2a Sql: Test SqlTest#testDefaultErrorCode fails with mssql
0f47355c2a is described below
commit 0f47355c2a2104f674c5d35f8a18f9476c3c14d1
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