Skip to content

Commit e8c0039

Browse files
committed
调整依赖及被移除的方法涉及测试用例
1 parent b1243a3 commit e8c0039

File tree

5 files changed

+7
-19
lines changed

5 files changed

+7
-19
lines changed

mybatis-plus/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
dependencies {
22
api project(":mybatis-plus-core")
33
api project(":mybatis-plus-annotation")
4-
api project(":mybatis-plus-extension")
4+
api project(":mybatis-plus-spring")
55

66
api "${lib.mybatis}"
77
api "${lib.'jsqlparser'}"

mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/h2/H2UserTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -667,11 +667,6 @@ void testDeleteByFill() {
667667
userService.removeById(h2User, true);
668668
userService.removeById(h2User, false);
669669
userService.removeBatchByIds(Arrays.asList(1L, 2L, h2User));
670-
userService.removeBatchByIds(Arrays.asList(1L, 2L, h2User), 2);
671-
userService.removeBatchByIds(Arrays.asList(1L, 2L, h2User), true);
672-
userService.removeBatchByIds(Arrays.asList(1L, 2L, h2User), false);
673-
userService.removeBatchByIds(Arrays.asList(1L, 2L, 3, "3", h2User), 2, true);
674-
userService.removeBatchByIds(Arrays.asList(1L, 2L, h2User), 2, false);
675670
}
676671

677672
@Test

mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/h2/cache/service/impl/CacheServiceImpl.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
11
package com.baomidou.mybatisplus.test.h2.cache.service.impl;
22

3-
import com.baomidou.mybatisplus.core.enums.SqlMethod;
43
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
54
import com.baomidou.mybatisplus.test.h2.cache.mapper.CacheMapper;
65
import com.baomidou.mybatisplus.test.h2.cache.model.CacheModel;
76
import com.baomidou.mybatisplus.test.h2.cache.service.ICacheService;
87
import org.springframework.stereotype.Service;
98
import org.springframework.transaction.annotation.Transactional;
109

11-
import java.util.Collection;
1210
import java.util.Collections;
1311

1412
@Service
1513
public class CacheServiceImpl extends ServiceImpl<CacheMapper, CacheModel> implements ICacheService {
1614

17-
//手动撸一个批量删除.
18-
private void removeBatchById(Collection<Long> idList) {
19-
String sqlStatement = sqlStatement(SqlMethod.DELETE_BY_ID);
20-
executeBatch(idList, (sqlSession, id) -> sqlSession.delete(sqlStatement, id));
21-
}
22-
2315
@Override
2416
@Transactional
2517
public long testBatchTransactionalClear1() {
@@ -66,7 +58,7 @@ public long testBatchTransactionalClear4() {
6658
public long testBatchTransactionalClear5() {
6759
CacheModel model = new CacheModel("靓仔");
6860
save(model);
69-
removeBatchById(Collections.singletonList(model.getId()));
61+
removeBatchByIds(Collections.singletonList(model.getId()));
7062
removeById(model.getId());
7163
return model.getId();
7264
}
@@ -76,7 +68,7 @@ public long testBatchTransactionalClear5() {
7668
public long testBatchTransactionalClear6() {
7769
CacheModel model = new CacheModel("靓仔");
7870
save(model);
79-
removeBatchById(Collections.singletonList(model.getId()));
71+
removeBatchByIds(Collections.singletonList(model.getId()));
8072
return model.getId();
8173
}
8274

@@ -86,7 +78,7 @@ public long testBatchTransactionalClear7() {
8678
CacheModel model = new CacheModel("靓仔");
8779
save(model);
8880
updateBatchById(Collections.singletonList(new CacheModel(model.getId(), "旺仔")));
89-
removeBatchById(Collections.singletonList(model.getId()));
81+
removeBatchByIds(Collections.singletonList(model.getId()));
9082
return model.getId();
9183
}
9284
}

mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/sqlrunner/SqlRunnerTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import java.util.Collections;
1414
import java.util.List;
1515

16+
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
17+
1618
/**
1719
* @author miemie
1820
* @since 2021-03-16

spring-boot-starter/mybatis-plus-spring-boot-autoconfigure/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
dependencies {
2-
api project(":mybatis-plus-spring")
3-
42
implementation project(":mybatis-plus")
53
implementation "${lib."mybatis-spring"}"
4+
implementation "${lib."mybatis-spring"}"
65
implementation "org.springframework.boot:spring-boot-autoconfigure:${springBootVersion}"
76
implementation "org.springframework.boot:spring-boot-starter-jdbc:${springBootVersion}"
87
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:${springBootVersion}"

0 commit comments

Comments
 (0)