|
|
|
@ -16,10 +16,15 @@
|
|
|
|
|
|
|
|
|
|
package org.springframework.boot.autoconfigure.websocket;
|
|
|
|
|
|
|
|
|
|
import java.net.URL;
|
|
|
|
|
|
|
|
|
|
import javax.websocket.server.ServerContainer;
|
|
|
|
|
|
|
|
|
|
import org.apache.catalina.webresources.TomcatURLStreamHandlerFactory;
|
|
|
|
|
import org.junit.After;
|
|
|
|
|
import org.junit.AfterClass;
|
|
|
|
|
import org.junit.Before;
|
|
|
|
|
import org.junit.BeforeClass;
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext;
|
|
|
|
@ -29,6 +34,7 @@ import org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletConta
|
|
|
|
|
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import org.springframework.test.util.ReflectionTestUtils;
|
|
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
|
|
|
|
|
@ -53,6 +59,14 @@ public class WebSocketAutoConfigurationTests {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@BeforeClass
|
|
|
|
|
@AfterClass
|
|
|
|
|
public static void uninstallUrlStreamHandlerFactory() {
|
|
|
|
|
ReflectionTestUtils.setField(TomcatURLStreamHandlerFactory.class, "instance",
|
|
|
|
|
null);
|
|
|
|
|
ReflectionTestUtils.setField(URL.class, "factory", null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void tomcatServerContainerIsAvailableFromTheServletContext() {
|
|
|
|
|
serverContainerIsAvailableFromTheServletContext(TomcatConfiguration.class,
|
|
|
|
|