java
@Bean
public ServerEndpointExporter serverEndpointExporter() {
return new ServerEndpointExporter();
}
这个在Websocket中,注入不进去,单元测试时报错
直接在@SpringBootTest加入
java
(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
就可以;
看这个