使用pagehelp总页数总是一页,不会分页

问题遇到的现象和发生背

在mvc项目中弄分页弄不了,弄了几天了

<plugins>
        <plugin interceptor="com.github.pagehelper.PageInterceptor">
            <property name="reasonable" value="true"/>
            <property name="helperDialect" value="mysql"/>
        </plugin>
    </plugins>
@Test
    public void testPageHelper(){
        PageHelper.startPage(1,3);
        List<Medicine> medicineList = medicineMapper.findMedicineList();
        PageInfo<Medicine> pageInfo = new PageInfo<>(medicineList);
        System.out.println("总页数为"+pageInfo.getPages());
    }

img

img

img

问题相关代码,请勿粘贴截图
运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果

是应该把配置的东西配置到spring的配置文件中,是我配置错地方了,搞了几天

不要用什么@Test去测试代码,老老实实写controller去访问接口

需要把PageInterceptor配置到SqlSessionFactory配置中