Add test for customize container factory

pull/138/head
Dave Syer 11 years ago
parent 4a60e3ccf6
commit c03a06b52d

@ -24,9 +24,12 @@ import java.util.Map;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.MutablePropertyValues;
import org.springframework.boot.bind.RelaxedDataBinder; import org.springframework.boot.bind.RelaxedDataBinder;
import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainerFactory;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
/** /**
* Tests for {@link ServerProperties}. * Tests for {@link ServerProperties}.
@ -68,6 +71,19 @@ public class ServerPropertiesTests {
.getProtocolHeader()); .getProtocolHeader());
} }
// FIXME test customize @Test
public void testCustomizeTomcat() throws Exception {
ConfigurableEmbeddedServletContainerFactory factory = mock(ConfigurableEmbeddedServletContainerFactory.class);
this.properties.customize(factory);
verify(factory).setContextPath("");
}
@Test
public void testCustomizeTomcatPort() throws Exception {
ConfigurableEmbeddedServletContainerFactory factory = mock(ConfigurableEmbeddedServletContainerFactory.class);
this.properties.setPort(8080);
this.properties.customize(factory);
verify(factory).setPort(8080);
}
} }

Loading…
Cancel
Save