SpringBoot单元测试报错jakarta.websocket.server.ServerContainer not available

原因:项目中加入了websocket服务端
解决办法:为SpringbootTest注解指定参数classes和webEnvironment,其中classes为启动类名称
@SpringBootTest(classes = App.class,webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)

posted @ 2025-02-19 10:45  狗狗没有坏心眼  阅读(435)  评论(0)    收藏  举报