From 66ffcf8fa94161a73e574d9e2ffed0b551507a35 Mon Sep 17 00:00:00 2001 From: Lucas Saldanha Date: Wed, 10 Oct 2018 11:39:20 +1300 Subject: [PATCH] Changing WebSocketService test to use random port (#5) --- .../ethereum/jsonrpc/websocket/WebSocketServiceTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ethereum/jsonrpc/src/test/java/net/consensys/pantheon/ethereum/jsonrpc/websocket/WebSocketServiceTest.java b/ethereum/jsonrpc/src/test/java/net/consensys/pantheon/ethereum/jsonrpc/websocket/WebSocketServiceTest.java index 2b92bb3e16..4a01c84dc7 100755 --- a/ethereum/jsonrpc/src/test/java/net/consensys/pantheon/ethereum/jsonrpc/websocket/WebSocketServiceTest.java +++ b/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 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