Add test for customize container factory
This commit is contained in:
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…
Reference in New Issue