alibaba / alibaba/testable-mock

mybatis-plus 支持吗

Open
#187 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.8k
Forks
306
PR merge metrics
No merged PRs in 30d

Description

@MockMethod(targetClass = BizPersonMapper.class)
List selectRoleInfoList(String personId) {
List listBeans = new ArrayList<>();
RoleInfoListBean roleInfoListBean = OmniConstructor.newInstance(RoleInfoListBean.class);
roleInfoListBean.setRoleManageKey("01");
listBeans.add(roleInfoListBean);
return listBeans;
}

@MockMethod(targetClass = BizPersonMapper.class)
BizPerson selectOne(LambdaQueryWrapper queryWrapper) {
BizPerson bizPerson = OmniConstructor.newInstance(BizPerson.class);
return bizPerson;
}
都是同一个mapper,第一个是正常的mapper可以正常调用,第二个是mybatis-plus,发现不支持

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how @MockMethod handles the two BizPersonMapper method signatures shown in the issue, then compare the normal mapper path with the MyBatis-Plus LambdaQueryWrapper case. Reproduce both examples and determine the expected supported behavior; done means the MyBatis-Plus method is handled consistently with the normal mapper.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.