From a954b1b1b7e029a0fcc52792c5b980b9a89be645 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Thu, 31 Oct 2024 11:04:01 +0800 Subject: [PATCH] test: update test --- .../java/com/mybatisflex/coretest/DynamicConditionTest.java | 2 +- .../test/java/com/mybatisflex/coretest/FunctionSqlTest.java | 2 +- .../java/com/mybatisflex/coretest/PlusCompatibleTest.java | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/DynamicConditionTest.java b/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/DynamicConditionTest.java index e7fec0fb..09755dd1 100644 --- a/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/DynamicConditionTest.java +++ b/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/DynamicConditionTest.java @@ -189,7 +189,7 @@ public class DynamicConditionTest { .where(ACCOUNT.USER_NAME.in("")); System.out.println(queryWrapper.toSQL()); - assertEquals("SELECT * FROM `tb_account`", queryWrapper.toSQL()); + assertEquals("SELECT * FROM `tb_account` WHERE `user_name` IN ('')", queryWrapper.toSQL()); // 重置QueryColumnBehavior QueryColumnBehavior.setIgnoreFunction(Objects::isNull); } diff --git a/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/FunctionSqlTest.java b/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/FunctionSqlTest.java index a5fc36fb..1e622b4f 100644 --- a/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/FunctionSqlTest.java +++ b/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/FunctionSqlTest.java @@ -132,7 +132,7 @@ public class FunctionSqlTest { .toSQL(); System.out.println(sql); - assertEquals("SELECT CASE WHEN SELECT `id` FROM `tb_article` WHERE `id` >= 1 >= 0 THEN 1 ELSE 0 END FROM `tb_account`", sql); + assertEquals("SELECT CASE WHEN (SELECT `id` FROM `tb_article` WHERE `id` >= 1) >= 0 THEN 1 ELSE 0 END FROM `tb_account`", sql); } @Test diff --git a/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/PlusCompatibleTest.java b/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/PlusCompatibleTest.java index 470ec36d..2d9eab38 100644 --- a/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/PlusCompatibleTest.java +++ b/mybatis-flex-core/src/test/java/com/mybatisflex/coretest/PlusCompatibleTest.java @@ -42,10 +42,7 @@ public class PlusCompatibleTest { .ge(Account::getSex, 0); }); - Assert.assertEquals("SELECT * FROM `user` " + - "WHERE `age` >= 18 " + - "OR (column2 LIKE 'value2%') " + - "OR (column3 = 'value3' AND `sex` >= 0)" + Assert.assertEquals("SELECT * FROM `user` WHERE `tb_account`.`age` >= 18 OR (column2 LIKE 'value2%') OR (column3 = 'value3' AND `tb_account`.`sex` >= 0)" , queryWrapper.toSQL()); System.out.println(queryWrapper.toSQL());