You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "zhfeng (via GitHub)" <gi...@apache.org> on 2023/04/13 08:58:01 UTC

[GitHub] [camel-quarkus] zhfeng commented on a diff in pull request #4769: Fix #4717 to expand camel-quarkus-mybatis test coverage

zhfeng commented on code in PR #4769:
URL: https://github.com/apache/camel-quarkus/pull/4769#discussion_r1165222210


##########
integration-tests/mybatis/src/test/java/org/apache/camel/quarkus/component/mybatis/it/MyBatisTest.java:
##########
@@ -70,17 +98,126 @@ public void testInsert() {
                 .body(equalTo("3"));
     }
 
+    public void testInsertRollback() {
+        Account account = new Account();
+        account.setId(999);
+        account.setFirstName("Rollback");
+        account.setLastName("Rollback");
+        account.setEmailAddress("Rollback@gmail.com");
+
+        RestAssured.given()
+                .contentType(ContentType.JSON)
+                .body(account)
+                .post("/mybatis/insertOne")
+                .then()
+                .statusCode(500);
+    }
+
+    public void testInsertList() {
+        Account account1 = new Account();
+        account1.setId(555);
+        account1.setFirstName("Aaron");
+        account1.setLastName("Daubman");
+        account1.setEmailAddress("ReadTheDevList@gmail.com");
+
+        Account account2 = new Account();
+        account2.setId(666);
+        account2.setFirstName("Amos");
+        account2.setLastName("Feng");
+        account2.setEmailAddress("ZHENG@gmail.com");
+
+        List<Account> accountList = new ArrayList<>(2);
+
+        accountList.add(account1);
+        accountList.add(account2);
+
+        RestAssured.given()
+                .contentType(ContentType.JSON)
+                .body(accountList)
+                .post("/mybatis/insertList")
+                .then()
+                .statusCode(200)
+                .body(equalTo("5"));

Review Comment:
   Well, there are 2 items in the `insert.sql` and the other one is in `testInsert()` .



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org