summaryrefslogtreecommitdiff
path: root/backend/src/test/java
diff options
context:
space:
mode:
authorJoffrey Bion <joffrey.bion@amadeus.com>2018-04-26 12:33:45 +0200
committerJoffrey Bion <joffrey.bion@amadeus.com>2018-04-26 12:38:13 +0200
commit0e9219dc5000fa12c2364c94363f2e2b535a39db (patch)
tree5597bc02017b866c96fb1bce1ed7cee488b80652 /backend/src/test/java
parentImprove full game test by using bought resources (diff)
downloadseven-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/java')
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/SevenWondersTest.java11
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);
}
bgstack15