1. 程式人生 > >Spring Boot中使用Test單元測試報錯javax.websocket.server.ServerContainer not available

Spring Boot中使用Test單元測試報錯javax.websocket.server.ServerContainer not available

測試mybatis註解增刪改查的時候,單元測試的時候,webSocket報錯。只需要在測試類增加註解

@SpringBootTest(classes = {Application.class},webEnvironment =SpringBootTest.WebEnvironment.RANDOM_PORT)

暫時不知道為什麼這樣就行了。有大神看見麻煩解下疑惑。