Open EthanCui6 opened 3 months ago
因为total是线程变量为0所以不会返回,要把PageHelper的一些方法也录制下来
@MetaInfServices(InvokePlugin.class)
public class PageHelperPlugin extends AbstractInvokePluginAdapter {
@Override
protected List<EnhanceModel> getEnhanceModelList() {
EnhanceModel enhanceModel = EnhanceModel.builder()
.classPattern("com.github.pagehelper.Page")
.methodPatterns(
MethodPattern.transform("getTotal", "getCountColumn", "getDialectClass", "getEndRow",
"getOrderBy", "getPageNum", "getPages", "getPageSize", "getPageSizeZero",
"getReasonable", "getStartRow"))
.watchTypes(EnhanceModel.RECORD_EVENT_TYPE).build();
return CollectionUtil.newArrayList(enhanceModel);
}
@Override
protected InvocationProcessor getInvocationProcessor() {
return new PageHelperInvocationProcessor(getType());
}
@Override
public InvokeType getType() {
return InvokeType.PAGE_HELPER;
}
@Override
public boolean isEntrance() {
return false;
}
}
如标题: lambda表达式中操作mysql, Mybatis mock成功,但是流程中断,Mock的数据没能正常返回 like this,使用的pagehelper的组件 PageHelper.startPage(1,15).doSelectPageInfo(() -> dao.select(arg1,arg2));