mica-boot-test 测试组件
介绍
由于在 mica-launcher 组件中我们埋入了一些配置,该组件为了方便单元测试。
依赖坐标
Maven
<dependency><groupId>net.dreamlu</groupId><artifactId>mica-boot-test</artifactId><scope>test</scope></dependency>
Gradle
testCompile "net.dreamlu:mica-boot-test"
使用
示例代码一
采用 @RunWith(MicaSpringRunner.class)。
@SpringBootTest@MicaBootTest("appName")@RunWith(MicaSpringRunner.class)public class MicaExampleApplicationTests {@Testpublic void contextLoads() {}}
示例代码二
继承 MicaBaseTest。
@SpringBootTest@MicaBootTest("appName")public class ApplicationTests extends MicaBaseTest {@Testpublic void contextLoads() {}}
说明:上面2种方式均可,@MicaBootTest 注解属性有:服务名、profile和enableLoader。
开源推荐
- Spring boot 微服务高效开发
mica工具集:https://gitee.com/596392912/mica Avue一款基于vue可配置化的神奇框架:https://gitee.com/smallweigit/avuepig宇宙最强微服务(架构师必备):https://gitee.com/log4j/pigSpringBlade完整的线上解决方案(企业开发必备):https://gitee.com/smallc/SpringBlade- 加入【如梦技术】Spring QQ群:479710041,了解更多。
关注我们

扫描上面二维码,更多精彩内容每天推荐!
