Commit 9c4dc0c6 authored by Phillip Webb's avatar Phillip Webb

Drop getPort from ConfEmbServletContainerFactory

Remove getPort() from ConfigurableEmbeddedServletContainerFactory to
keep the interface primarily setters.
parent 468728a2
......@@ -25,6 +25,7 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.Mockito;
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.context.embedded.AbstractEmbeddedServletContainerFactory;
import org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext;
import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainerFactory;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
......@@ -108,7 +109,8 @@ public class ServerPropertiesAutoConfigurationTests {
assertNotNull(server);
// The server.port environment property was not explicitly set so the container
// factory should take precedence...
assertEquals(3000, containerFactory.getPort());
assertEquals(3000,
((AbstractEmbeddedServletContainerFactory) containerFactory).getPort());
}
@Test
......
......@@ -131,9 +131,9 @@ public abstract class AbstractEmbeddedServletContainerFactory implements
}
/**
* Returns the port that the embedded servlet container should listen on.
* The port that the embedded server listens on.
* @return the port
*/
@Override
public int getPort() {
return this.port;
}
......
......@@ -48,12 +48,6 @@ public interface ConfigurableEmbeddedServletContainerFactory extends
*/
void setPort(int port);
/**
* The port that the embedded server listens on.
* @return the port
*/
int getPort();
/**
* The session timeout in seconds (default 30). If 0 or negative then sessions never
* expire.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment