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;
}
Aggregations