Avoid creating a new EmbeddedServletContainerFactory for websockets

User can now also switch off and customize the websockets customizer by adding
a bean named "websocketContainerCustomizer".

Fixes gh-479
This commit is contained in:
Dave Syer
2014-03-12 09:19:00 +00:00
parent 34efda1890
commit 14d52b6c18
5 changed files with 154 additions and 16 deletions

View File

@@ -29,6 +29,7 @@ import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletCont
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
/**
@@ -75,7 +76,7 @@ public class ServerPropertiesTests {
public void testCustomizeTomcat() throws Exception {
ConfigurableEmbeddedServletContainer factory = mock(ConfigurableEmbeddedServletContainer.class);
this.properties.customize(factory);
verify(factory).setContextPath("");
verify(factory, times(0)).setContextPath("");
}
@Test