diff options
author | Joffrey Bion <joffrey.bion@amadeus.com> | 2018-04-26 12:33:45 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@amadeus.com> | 2018-04-26 12:38:13 +0200 |
commit | 0e9219dc5000fa12c2364c94363f2e2b535a39db (patch) | |
tree | 5597bc02017b866c96fb1bce1ed7cee488b80652 /backend/src/test | |
parent | Improve full game test by using bought resources (diff) | |
download | seven-wonders-0e9219dc5000fa12c2364c94363f2e2b535a39db.tar.gz seven-wonders-0e9219dc5000fa12c2364c94363f2e2b535a39db.tar.bz2 seven-wonders-0e9219dc5000fa12c2364c94363f2e2b535a39db.zip |
Use independent WS clients for each test to prevent race conditions on CI
Diffstat (limited to 'backend/src/test')
-rw-r--r-- | backend/src/test/java/org/luxons/sevenwonders/SevenWondersTest.java | 11 |
1 files changed, 3 insertions, 8 deletions
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); } |