报错信息如下:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverEndpointExporter' defined in class path resource [com/example/wechat/util/WebSocketUtil.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: javax.websocket.server.ServerContainer not available
在SpringBoot测试类上添加如下注解即可解决
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)