springboot junit

junit单元测试 spring boot dubbo服务项目的时候报错MockServerContainer does not support addEndpoint 

在@SpringBootTest中加上SpringBootTest.WebEnvironment.RANDOM_PORT成功解决错误,如下:

@RunWith(SpringRunner.class) 

@SpringBootTest(classes = FieldApplication.class,webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)

posted @ 2018-11-05 15:28  jiabei  阅读(1233)  评论(4编辑  收藏  举报