springboot junit

Posted jiabei

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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)

以上是关于springboot junit的主要内容,如果未能解决你的问题,请参考以下文章