Mybatis-plus: mybatis-spring-boot-starter-test integration

Created on 4 Jun 2019  ·  2Comments  ·  Source: baomidou/mybatis-plus

当前使用版本(必须填写清楚,否则不予处理)

 <dependency>
        <groupId>com.baomidou</groupId>
        <artifactId>mybatis-plus-boot-starter</artifactId>
        <version>3.1.0</version>
    </dependency>

该问题是怎么引起的?(最新版上已修复的会直接close掉)

无法方便的进行最小规模的集成测试

重现步骤

利用mybatis-spring-boot-test-autoconfigure 进行mapper的单元测试,缺乏支持,直接报错.
因为MPG进行了configruation 和 sqlsessionfactory的替换.
http://www.mybatis.org/spring-boot-starter/mybatis-spring-boot-test-autoconfigure/

报错信息

Caused by: java.io.FileNotFoundException: class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:180) at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:51) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103) at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.createMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:88) at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.getMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:75) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:81) at org.springframework.boot.autoconfigure.AutoConfigurationSorter$AutoConfigurationClass.getAnnotationMetadata(AutoConfigurationSorter.java:241) ... 51 more

All 2 comments

自己想办法

态度真差

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sunqqqq picture sunqqqq  ·  3Comments

UnknownDeveloper007 picture UnknownDeveloper007  ·  8Comments

FelixLiuSheng picture FelixLiuSheng  ·  8Comments

zhenyuT picture zhenyuT  ·  9Comments

4pxzhou picture 4pxzhou  ·  3Comments