From 0e9219dc5000fa12c2364c94363f2e2b535a39db Mon Sep 17 00:00:00 2001 From: Joffrey Bion Date: Thu, 26 Apr 2018 12:33:45 +0200 Subject: Use independent WS clients for each test to prevent race conditions on CI --- .../test/java/org/luxons/sevenwonders/SevenWondersTest.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'backend/src/test/java/org/luxons') diff --git a/backend/src/test/java/org/luxons/sevenwonders/SevenWondersTest.java b/backend/src/test/java/org/luxons/sevenwonders/SevenWondersTest.java index 9c060673..5a618243 100644 --- a/backend/src/test/java/org/luxons/sevenwonders/SevenWondersTest.java +++ b/backend/src/test/java/org/luxons/sevenwonders/SevenWondersTest.java @@ -8,7 +8,6 @@ import org.hildan.jackstomp.Channel; import org.hildan.jackstomp.JackstompSession; import org.junit.After; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.luxons.sevenwonders.test.api.ApiLobby; @@ -31,20 +30,16 @@ public class SevenWondersTest { private static final String WEBSOCKET_URI = "ws://localhost:%d"; - private static SevenWondersClient client; + private SevenWondersClient client; @LocalServerPort private int randomServerPort; private String serverUrl; - @BeforeClass - public static void createClient() { - client = new SevenWondersClient(); - } - @Before - public void setServerUrl() { + public void setUpClientAndUrl() { + client = new SevenWondersClient(); serverUrl = String.format(WEBSOCKET_URI, randomServerPort); } -- cgit