一、简单介绍
mybatis-spring-boot-test是Mybatis提供的用于单元测试的一个小工具,类似于spring-boot-test中对JPA,Jdbc的支持,通过引入mybatis-spring-boot-test,我们可以很方便的测试我们的Mapper接口;
参考文档:【官网地址】
二、核心APi
- @MybatisTest:标明这是一个Mybatis单元测试;
三、示例
package com.firewolf.busi.example.springtest;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mybatis.spring.boot.test.autoconfigure.MybatisTest;
import org<