在springboot测试类的时候出现这个错误
2019-07-25 19:38:02,252 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘serverEndpointExporter’ defined in class path resource [com/sell/config/WebSocketConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: javax.websocket.server.ServerContainer not available
要在测试类的上面加上
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
这个注解