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