SpringBoot中使用WebSocket后进行测试报错

背景

今天测试controller时突然报错

主要是以下这一句

Error creating bean with name 'serverEndpointExporter' defined in class path resource

解决方案

在Test类的@SpringBootTest注解后加上

(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)

即变成

发布了154 篇原创文章 · 获赞 55 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/weixin_42089175/article/details/98468366