|
@@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.test.h2.enums.AgeEnum;
|
|
import com.baomidou.mybatisplus.test.h2.service.IH2UserService;
|
|
import com.baomidou.mybatisplus.test.h2.service.IH2UserService;
|
|
import net.sf.jsqlparser.parser.CCJSqlParserUtil;
|
|
import net.sf.jsqlparser.parser.CCJSqlParserUtil;
|
|
import net.sf.jsqlparser.statement.select.Select;
|
|
import net.sf.jsqlparser.statement.select.Select;
|
|
|
|
+import org.apache.ibatis.exceptions.PersistenceException;
|
|
import org.junit.jupiter.api.*;
|
|
import org.junit.jupiter.api.*;
|
|
import org.junit.jupiter.api.extension.ExtendWith;
|
|
import org.junit.jupiter.api.extension.ExtendWith;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -342,6 +343,19 @@ class H2UserTest extends BaseTest {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
+ @Order(28)
|
|
|
|
+ void testSaveBatchException() {
|
|
|
|
+ try {
|
|
|
|
+ userService.saveBatch(Arrays.asList(
|
|
|
|
+ new H2User(1L, "tom"),
|
|
|
|
+ new H2User(1L, "andy")
|
|
|
|
+ ));
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ Assertions.assertTrue(e instanceof PersistenceException);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
@Test
|
|
@Test
|
|
public void myQueryWithGroupByOrderBy(){
|
|
public void myQueryWithGroupByOrderBy(){
|
|
userService.mySelectMaps().forEach(System.out::println);
|
|
userService.mySelectMaps().forEach(System.out::println);
|