Springboot 单元测试报错:javax.websocket.server.ServerContainer not available
错误描述
解决方案
@SpringBootTest(webEnvironment=SpringBootTest.WebEnvironment.RANDOM_PORT)
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.List;
/**
* @Description :
* @Author :
* @CreateTime : 2024/12/17
*/
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment=SpringBootTest.WebEnvironment.RANDOM_PORT)
public class DataScreenTest {
@Test
public void monthlyStatistics() {
log.info("test");
}
}