我们的广告服务商并不跟踪您的隐私,为了支持本站的长期运营,请将我们的网站加入广告拦截器的白名单,谢谢!
自动导入 MyBatis-Plus 测试所需相关配置,通过 @MybatisPlusTest 注解快速配置测试类。
@MybatisPlusTest
添加测试依赖
<dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter-test</artifactId> <version>3.5.9</version></dependency>
implementation 'com.baomidou:mybatis-plus-boot-starter-test:3.5.9'
编写测试用例
import org.junit.jupiter.api.Test;import org.springframework.beans.factory.annotation.Autowired; import static org.assertj.core.api.Assertions.assertThat; @MybatisPlusTestclass MybatisPlusSampleTest { @Autowired private SampleMapper sampleMapper; @Test void testInsert() { Sample sample = new Sample(); sampleMapper.insert(sample); assertThat(sample.getId()).isNotNull(); }}
© 2016-2024 Baomidou™. All Rights Reserved.
Power by Astro Starlight | Sponsored by JetBrains
渝ICP备2021000141号-1 | 渝公网安备50011302222097