Changing WebSocketService test to use random port (#5)

Lucas Saldanha 6 years ago committed by GitHub
parent 659260560d
commit 66ffcf8fa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ethereum/jsonrpc/src/test/java/net/consensys/pantheon/ethereum/jsonrpc/websocket/WebSocketServiceTest.java

@ -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

Loading…
Cancel
Save