Rename EmbeddedServletContainer -> EmbeddedWebServer
This contract is not specific to servlet containers and should be reused by all web server implementations (including reactive variants). Fixes gh-8208
This commit is contained in:
@@ -571,7 +571,7 @@ To scan for a free port (using OS natives to prevent clashes) use `server.port=0
|
||||
[[howto-discover-the-http-port-at-runtime]]
|
||||
=== Discover the HTTP port at runtime
|
||||
You can access the port the server is running on from log output or from the
|
||||
`EmbeddedWebApplicationContext` via its `EmbeddedServletContainer`. The best way to get
|
||||
`EmbeddedWebApplicationContext` via its `EmbeddedWebServer`. The best way to get
|
||||
that and be sure that it has initialized is to add a `@Bean` of type
|
||||
`ApplicationListener<EmbeddedServletContainerInitializedEvent>` and pull the container
|
||||
out of the event when it is published.
|
||||
|
||||
@@ -41,7 +41,7 @@ public class TomcatLegacyCookieProcessorExampleTests {
|
||||
EmbeddedWebApplicationContext applicationContext = (EmbeddedWebApplicationContext) new SpringApplication(
|
||||
TestConfiguration.class, LegacyCookieProcessorConfiguration.class).run();
|
||||
Context context = (Context) ((TomcatEmbeddedServletContainer) applicationContext
|
||||
.getEmbeddedServletContainer()).getTomcat().getHost().findChildren()[0];
|
||||
.getEmbeddedWebServer()).getTomcat().getHost().findChildren()[0];
|
||||
assertThat(context.getCookieProcessor())
|
||||
.isInstanceOf(LegacyCookieProcessor.class);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user