Changing WebSocketService test to use random port (#5)

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
This commit is contained in:
Lucas Saldanha
2018-10-10 11:39:20 +13:00
committed by GitHub
parent 1e7345ef56
commit b6d150e60e

View File

@@ -38,6 +38,8 @@ public class WebSocketServiceTest {
vertx = Vertx.vertx();
websocketConfiguration = WebSocketConfiguration.createDefault();
websocketConfiguration.setPort(0);
final Map<String, JsonRpcMethod> websocketMethods =
new WebSocketMethodsFactory(new SubscriptionManager(), new HashMap<>()).methods();
webSocketRequestHandlerSpy = spy(new WebSocketRequestHandler(vertx, websocketMethods));
@@ -45,6 +47,8 @@ public class WebSocketServiceTest {
websocketService =
new WebSocketService(vertx, websocketConfiguration, webSocketRequestHandlerSpy);
websocketService.start().join();
websocketConfiguration.setPort(websocketService.socketAddress().getPort());
}
@After