Search in sources :

Example 1 with ServletWebServerInitializedEvent

use of org.springframework.boot.web.servlet.context.ServletWebServerInitializedEvent in project spring-boot by spring-projects.

the class EmbeddedServerPortFileWriterTests method mockEvent.

private ServletWebServerInitializedEvent mockEvent(String name, int port) {
    ServletWebServerApplicationContext applicationContext = mock(ServletWebServerApplicationContext.class);
    WebServer source = mock(WebServer.class);
    given(applicationContext.getNamespace()).willReturn(name);
    given(source.getPort()).willReturn(port);
    ServletWebServerInitializedEvent event = new ServletWebServerInitializedEvent(applicationContext, source);
    return event;
}
Also used : WebServer(org.springframework.boot.web.server.WebServer) ServletWebServerApplicationContext(org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext) ServletWebServerInitializedEvent(org.springframework.boot.web.servlet.context.ServletWebServerInitializedEvent)

Aggregations

WebServer (org.springframework.boot.web.server.WebServer)1 ServletWebServerApplicationContext (org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext)1 ServletWebServerInitializedEvent (org.springframework.boot.web.servlet.context.ServletWebServerInitializedEvent)1