use of org.springframework.cloud.gateway.test.support.ReactorHttpServer in project spring-cloud-gateway by spring-cloud.
the class WebSocketIntegrationTests method setup.
@Before
public void setup() throws Exception {
this.client = new ReactorNettyWebSocketClient();
this.server = new ReactorHttpServer();
this.server.setHandler(createHttpHandler());
this.server.afterPropertiesSet();
this.server.start();
// Set dynamically chosen port
this.serverPort = this.server.getPort();
if (this.client instanceof Lifecycle) {
((Lifecycle) this.client).start();
}
this.gatewayContext = new SpringApplicationBuilder(GatewayConfig.class).properties("ws.server.port:" + this.serverPort, "server.port=0", "spring.jmx.enabled=false").run();
ConfigurableEnvironment env = this.gatewayContext.getBean(ConfigurableEnvironment.class);
this.gatewayPort = new Integer(env.getProperty("local.server.port"));
}
use of org.springframework.cloud.gateway.test.support.ReactorHttpServer in project spring-cloud-gateway by spring-cloud.
the class SseIntegrationTests method setup.
@Before
public void setup() throws Exception {
this.server = new ReactorHttpServer();
this.server.setHandler(createHttpHandler());
this.server.afterPropertiesSet();
this.server.start();
// Set dynamically chosen port
this.serverPort = this.server.getPort();
logger.info("SSE Port: " + this.serverPort);
this.gatewayContext = new SpringApplicationBuilder(GatewayConfig.class).properties("sse.server.port:" + this.serverPort, "server.port=0", "spring.jmx.enabled=false").run();
ConfigurableEnvironment env = this.gatewayContext.getBean(ConfigurableEnvironment.class);
this.gatewayPort = new Integer(env.getProperty("local.server.port"));
this.webClient = WebClient.create("http://localhost:" + this.gatewayPort + "/sse");
logger.info("Gateway Port: " + this.gatewayPort);
}
Aggregations