当该服务未引入其他服务时:@RunWith(SpringRunner.class)
@SpringBootTest
当该服务引入其他服务时:@RunWith(SpringRunner.class)
@SpringBootTest(classes = {HuobaoOrderServiceApplication.class<启动类的class>, HuobaoOrderServiceApplicationTests.class<测试类的class>})
若不写上述…class,会产生查找多个启动类异常
java.lang.IllegalStateException: Found multiple @SpringBootConfiguration annotated classes [Generic bean: class[xxx.xx.xx];
微服务下单个生产者服务单元测试
最新推荐文章于 2024-07-30 20:50:32 发布