summaryrefslogtreecommitdiff
path: root/backend/src/test/java/org/luxons
diff options
context:
space:
mode:
Diffstat (limited to 'backend/src/test/java/org/luxons')
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/api/TableTest.java2
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/boards/BoardTest.java6
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/boards/MilitaryTest.java6
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/boards/RelativeBoardPositionTest.java6
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/boards/ScienceTest.java20
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/cards/CardBackTest.java2
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/cards/CardTest.java7
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/cards/DecksTest.java8
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/cards/HandRotationDirectionTest.java2
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/cards/HandsTest.java8
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/cards/RequirementsTest.java8
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/data/GameDefinitionLoaderTest.java4
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/data/GameDefinitionTest.java2
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/data/definitions/WonderSidePickMethodTest.java2
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/NumericEffectSerializerTest.java4
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ProductionIncreaseSerializerTest.java5
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ProductionSerializerTest.java16
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ResourceTypeSerializerTest.java9
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ResourceTypesSerializerTest.java8
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ResourcesSerializerTest.java5
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ScienceProgressSerializerTest.java5
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/effects/BonusPerBoardElementTest.java17
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/effects/DiscountTest.java6
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/effects/GoldIncreaseTest.java8
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/effects/MilitaryReinforcementsTest.java8
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/effects/ProductionIncreaseTest.java6
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/effects/RawPointsIncreaseTest.java6
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/effects/ScienceProgressTest.java4
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/effects/SpecialAbilityActivationTest.java6
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/resources/ProductionTest.java6
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/resources/ResourcesTest.java2
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/resources/TradingRulesTest.java6
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/lobby/LobbyTest.java2
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/repositories/LobbyRepositoryTest.java4
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/repositories/PlayerRepositoryTest.java2
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/validation/DestinationAccessValidatorTest.java4
36 files changed, 120 insertions, 102 deletions
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/api/TableTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/api/TableTest.java
index 9ed0af02..71dbeb89 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/api/TableTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/api/TableTest.java
@@ -46,4 +46,4 @@ public class TableTest {
assertEquals(table.getBoard(1), table.getBoard(1, RelativeBoardPosition.SELF));
assertEquals(table.getBoard(2), table.getBoard(1, RelativeBoardPosition.RIGHT));
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/boards/BoardTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/boards/BoardTest.java
index 1dbe7dc7..451f8bb9 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/boards/BoardTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/boards/BoardTest.java
@@ -20,14 +20,14 @@ import org.luxons.sevenwonders.game.test.TestUtils;
import static junit.framework.TestCase.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.*;
+import static org.junit.Assume.assumeTrue;
@RunWith(Theories.class)
public class BoardTest {
@DataPoints("gold")
public static int[] goldAmounts() {
- return new int[]{-3, -1, 0, 1, 2, 3};
+ return new int[] {-3, -1, 0, 1, 2, 3};
}
@DataPoints("nbCards")
@@ -105,4 +105,4 @@ public class BoardTest {
TestUtils.addCards(board, nbOtherCards, TestUtils.getDifferentColorFrom(color1, color2));
assertEquals(nbCards1 + nbCards2, board.getNbCardsOfColor(Arrays.asList(color1, color2)));
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/boards/MilitaryTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/boards/MilitaryTest.java
index 16073e91..ccea0f15 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/boards/MilitaryTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/boards/MilitaryTest.java
@@ -37,8 +37,8 @@ public class MilitaryTest {
}
@Theory
- public void victory_addsCorrectPoints(@FromDataPoints("ages") int age, @FromDataPoints("points") int
- nbPointsPerVictory) {
+ public void victory_addsCorrectPoints(@FromDataPoints("ages") int age,
+ @FromDataPoints("points") int nbPointsPerVictory) {
Military military = createMilitary(age, nbPointsPerVictory, 0);
int initialPoints = military.getTotalPoints();
@@ -61,4 +61,4 @@ public class MilitaryTest {
military.defeat();
assertEquals(initialPoints - nbPointsLostPerDefeat, military.getTotalPoints());
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/boards/RelativeBoardPositionTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/boards/RelativeBoardPositionTest.java
index e95a1e37..9f60e572 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/boards/RelativeBoardPositionTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/boards/RelativeBoardPositionTest.java
@@ -5,8 +5,8 @@ import org.junit.experimental.theories.Theories;
import org.junit.experimental.theories.Theory;
import org.junit.runner.RunWith;
-import static org.junit.Assert.*;
-import static org.junit.Assume.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assume.assumeTrue;
@RunWith(Theories.class)
public class RelativeBoardPositionTest {
@@ -41,4 +41,4 @@ public class RelativeBoardPositionTest {
assertEquals(1, RelativeBoardPosition.SELF.getIndexFrom(1, nbPlayers));
assertEquals(2, RelativeBoardPosition.RIGHT.getIndexFrom(1, nbPlayers));
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/boards/ScienceTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/boards/ScienceTest.java
index 067a7eff..24c63b31 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/boards/ScienceTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/boards/ScienceTest.java
@@ -15,21 +15,9 @@ public class ScienceTest {
@DataPoints
public static int[][] quantitiesWithExpectedPoints() {
// compasses, wheels, tablets, jokers, expected points
- return new int[][]{
- {0, 0, 0, 1, 1},
- {0, 0, 1, 0, 1},
- {0, 0, 0, 2, 4},
- {0, 0, 1, 1, 4},
- {0, 0, 2, 0, 4},
- {0, 0, 0, 3, 10},
- {0, 0, 1, 2, 10},
- {0, 1, 1, 1, 10},
- {1, 1, 1, 0, 10},
- {0, 0, 0, 4, 16},
- {0, 0, 1, 3, 16},
- {0, 0, 2, 2, 16},
- {0, 0, 3, 1, 16},
- {0, 0, 4, 0, 16}};
+ return new int[][] {{0, 0, 0, 1, 1}, {0, 0, 1, 0, 1}, {0, 0, 0, 2, 4}, {0, 0, 1, 1, 4}, {0, 0, 2, 0, 4},
+ {0, 0, 0, 3, 10}, {0, 0, 1, 2, 10}, {0, 1, 1, 1, 10}, {1, 1, 1, 0, 10}, {0, 0, 0, 4, 16},
+ {0, 0, 1, 3, 16}, {0, 0, 2, 2, 16}, {0, 0, 3, 1, 16}, {0, 0, 4, 0, 16}};
}
@DataPoints
@@ -110,4 +98,4 @@ public class ScienceTest {
Science science = TestUtils.createScience(expectation[0], expectation[1], expectation[2], expectation[3]);
assertEquals(expectation[4], science.computePoints());
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/cards/CardBackTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/cards/CardBackTest.java
index d105c33f..a4f8b95b 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/cards/CardBackTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/cards/CardBackTest.java
@@ -12,4 +12,4 @@ public class CardBackTest {
CardBack back = new CardBack(imagePath);
assertEquals(imagePath, back.getImage());
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/cards/CardTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/cards/CardTest.java
index 0d40bc9a..437c5f21 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/cards/CardTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/cards/CardTest.java
@@ -14,8 +14,11 @@ import org.luxons.sevenwonders.game.effects.ProductionIncrease;
import org.luxons.sevenwonders.game.resources.ResourceType;
import org.luxons.sevenwonders.game.wonders.Wonder;
-import static org.junit.Assert.*;
-import static org.luxons.sevenwonders.game.test.TestUtils.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
+import static org.luxons.sevenwonders.game.test.TestUtils.createCard;
public class CardTest {
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/cards/DecksTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/cards/DecksTest.java
index 06060f16..934fcaf1 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/cards/DecksTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/cards/DecksTest.java
@@ -14,8 +14,10 @@ import org.junit.runner.RunWith;
import org.luxons.sevenwonders.game.cards.Decks.CardNotFoundException;
import org.luxons.sevenwonders.game.test.TestUtils;
-import static org.junit.Assert.*;
-import static org.junit.Assume.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeTrue;
@RunWith(Theories.class)
public class DecksTest {
@@ -107,4 +109,4 @@ public class DecksTest {
assertEquals(nbCardsPerPlayer, hands.get(i).size());
}
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/cards/HandRotationDirectionTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/cards/HandRotationDirectionTest.java
index 6165d158..d027464a 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/cards/HandRotationDirectionTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/cards/HandRotationDirectionTest.java
@@ -12,4 +12,4 @@ public class HandRotationDirectionTest {
assertEquals(HandRotationDirection.RIGHT, HandRotationDirection.forAge(2));
assertEquals(HandRotationDirection.LEFT, HandRotationDirection.forAge(3));
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/cards/HandsTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/cards/HandsTest.java
index 494b9e4c..c20508e6 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/cards/HandsTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/cards/HandsTest.java
@@ -15,8 +15,10 @@ import org.luxons.sevenwonders.game.api.Table;
import org.luxons.sevenwonders.game.cards.Hands.PlayerIndexOutOfBoundsException;
import org.luxons.sevenwonders.game.test.TestUtils;
-import static org.junit.Assert.*;
-import static org.junit.Assume.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeTrue;
@RunWith(Theories.class)
public class HandsTest {
@@ -138,4 +140,4 @@ public class HandsTest {
assertTrue(hand0.contains(handCard.getCard()));
}
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/cards/RequirementsTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/cards/RequirementsTest.java
index d851ae30..a6e5151d 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/cards/RequirementsTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/cards/RequirementsTest.java
@@ -60,7 +60,8 @@ public class RequirementsTest {
}
@Theory
- public void resourceRequirement_ownProduction(ResourceType initialResource, ResourceType producedResource, ResourceType requiredResource) {
+ public void resourceRequirement_ownProduction(ResourceType initialResource, ResourceType producedResource,
+ ResourceType requiredResource) {
assumeTrue(initialResource != requiredResource);
Resources resources = TestUtils.createResources(requiredResource);
@@ -72,11 +73,12 @@ public class RequirementsTest {
Table table = new Table(Collections.singletonList(board));
assertEquals(producedResource == requiredResource, requirements.isAffordedBy(board));
- assertEquals(producedResource == requiredResource, requirements.isAffordedBy(table, 0, Collections.emptyList()));
+ assertEquals(producedResource == requiredResource,
+ requirements.isAffordedBy(table, 0, Collections.emptyList()));
if (producedResource == requiredResource) {
assertTrue(requirements.couldBeAffordedBy(table, 0));
}
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/data/GameDefinitionLoaderTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/data/GameDefinitionLoaderTest.java
index b38afd49..36a42c61 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/data/GameDefinitionLoaderTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/data/GameDefinitionLoaderTest.java
@@ -2,7 +2,7 @@ package org.luxons.sevenwonders.game.data;
import org.junit.Test;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertNotNull;
public class GameDefinitionLoaderTest {
@@ -13,4 +13,4 @@ public class GameDefinitionLoaderTest {
assertNotNull(gameDefinition);
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/data/GameDefinitionTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/data/GameDefinitionTest.java
index a5b37edd..f29b33d9 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/data/GameDefinitionTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/data/GameDefinitionTest.java
@@ -16,4 +16,4 @@ public class GameDefinitionTest {
Game game = gameDefinition.initGame(0, new CustomizableSettings(), 7);
assertNotNull(game);
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/data/definitions/WonderSidePickMethodTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/data/definitions/WonderSidePickMethodTest.java
index 2544ca64..b75c9f42 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/data/definitions/WonderSidePickMethodTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/data/definitions/WonderSidePickMethodTest.java
@@ -93,4 +93,4 @@ public class WonderSidePickMethodTest {
assertEquals(WonderSide.A, WonderSidePickMethod.SAME_RANDOM_FOR_ALL.pickSide(random, null));
assertEquals(WonderSide.B, WonderSidePickMethod.SAME_RANDOM_FOR_ALL.pickSide(random2, null));
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/NumericEffectSerializerTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/NumericEffectSerializerTest.java
index 753a26cf..196e2128 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/NumericEffectSerializerTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/NumericEffectSerializerTest.java
@@ -13,7 +13,7 @@ import org.luxons.sevenwonders.game.effects.RawPointsIncrease;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
@RunWith(Theories.class)
public class NumericEffectSerializerTest {
@@ -125,4 +125,4 @@ public class NumericEffectSerializerTest {
public void deserialize_failOnUnknownType() {
gson.fromJson("\"2\"", ProductionIncrease.class);
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ProductionIncreaseSerializerTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ProductionIncreaseSerializerTest.java
index f4b41628..faa1b430 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ProductionIncreaseSerializerTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ProductionIncreaseSerializerTest.java
@@ -13,7 +13,8 @@ import org.luxons.sevenwonders.game.resources.Resources;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
public class ProductionIncreaseSerializerTest {
@@ -185,4 +186,4 @@ public class ProductionIncreaseSerializerTest {
public void deserialize_failOnMultipleResourcesInChoice() {
gson.fromJson("\"W/SS/C\"", ProductionIncrease.class);
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ProductionSerializerTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ProductionSerializerTest.java
index 34a06ce4..4516c2ec 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ProductionSerializerTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ProductionSerializerTest.java
@@ -12,7 +12,8 @@ import org.luxons.sevenwonders.game.resources.Resources;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
public class ProductionSerializerTest {
@@ -20,12 +21,13 @@ public class ProductionSerializerTest {
@Before
public void setUp() {
- Type resourceTypeList = new TypeToken<List<ResourceType>>() {}.getType();
+ Type resourceTypeList = new TypeToken<List<ResourceType>>() {
+ }.getType();
gson = new GsonBuilder().registerTypeAdapter(Resources.class, new ResourcesSerializer())
- .registerTypeAdapter(ResourceType.class, new ResourceTypeSerializer())
- .registerTypeAdapter(resourceTypeList, new ResourceTypesSerializer())
- .registerTypeAdapter(Production.class, new ProductionSerializer())
- .create();
+ .registerTypeAdapter(ResourceType.class, new ResourceTypeSerializer())
+ .registerTypeAdapter(resourceTypeList, new ResourceTypesSerializer())
+ .registerTypeAdapter(Production.class, new ProductionSerializer())
+ .create();
}
private static Production create(int wood, int stone, int clay) {
@@ -195,4 +197,4 @@ public class ProductionSerializerTest {
gson.fromJson("\"W/SS/C\"", Production.class);
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ResourceTypeSerializerTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ResourceTypeSerializerTest.java
index 86f3f5ab..5ff544b0 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ResourceTypeSerializerTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ResourceTypeSerializerTest.java
@@ -6,7 +6,8 @@ import org.luxons.sevenwonders.game.resources.ResourceType;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
public class ResourceTypeSerializerTest {
@@ -20,7 +21,7 @@ public class ResourceTypeSerializerTest {
@Test
public void serialize_useSymbolForEachType() {
for (ResourceType type : ResourceType.values()) {
- String expectedJson = "\"" + type.getSymbol() + "\"";
+ String expectedJson = "\"" + type.getSymbol() + "\"";
assertEquals(expectedJson, gson.toJson(type));
}
}
@@ -28,7 +29,7 @@ public class ResourceTypeSerializerTest {
@Test
public void deserialize_useSymbolForEachType() {
for (ResourceType type : ResourceType.values()) {
- String typeInJson = "\"" + type.getSymbol() + "\"";
+ String typeInJson = "\"" + type.getSymbol() + "\"";
assertEquals(type, gson.fromJson(typeInJson, ResourceType.class));
}
}
@@ -47,4 +48,4 @@ public class ResourceTypeSerializerTest {
public void deserialize_failsOnGarbageString() {
gson.fromJson("\"thisisgarbage\"", ResourceType.class);
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ResourceTypesSerializerTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ResourceTypesSerializerTest.java
index 4ebbc33f..c2972c60 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ResourceTypesSerializerTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ResourceTypesSerializerTest.java
@@ -11,7 +11,8 @@ import org.luxons.sevenwonders.game.resources.ResourceType;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
public class ResourceTypesSerializerTest {
@@ -23,7 +24,8 @@ public class ResourceTypesSerializerTest {
}
private static Type createListTypeToken() {
- return new TypeToken<List<ResourceType>>() {}.getType();
+ return new TypeToken<List<ResourceType>>() {
+ }.getType();
}
@Test
@@ -97,4 +99,4 @@ public class ResourceTypesSerializerTest {
types.add(ResourceType.STONE);
assertEquals(types, gson.fromJson("\"WCS\"", createListTypeToken()));
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ResourcesSerializerTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ResourcesSerializerTest.java
index 1fd01337..884e1425 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ResourcesSerializerTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ResourcesSerializerTest.java
@@ -7,7 +7,8 @@ import org.luxons.sevenwonders.game.resources.Resources;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
public class ResourcesSerializerTest {
@@ -104,4 +105,4 @@ public class ResourcesSerializerTest {
resources.add(ResourceType.STONE, 3);
assertEquals(resources, gson.fromJson("\"SCWCSS\"", Resources.class));
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ScienceProgressSerializerTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ScienceProgressSerializerTest.java
index 40088fda..34e1f5ed 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ScienceProgressSerializerTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/data/serializers/ScienceProgressSerializerTest.java
@@ -8,7 +8,8 @@ import org.luxons.sevenwonders.game.test.TestUtils;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
public class ScienceProgressSerializerTest {
@@ -142,4 +143,4 @@ public class ScienceProgressSerializerTest {
assertEquals(1, progress.getScience().getJokers());
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/effects/BonusPerBoardElementTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/effects/BonusPerBoardElementTest.java
index 5f42bc53..a783ba5a 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/effects/BonusPerBoardElementTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/effects/BonusPerBoardElementTest.java
@@ -16,7 +16,7 @@ import org.luxons.sevenwonders.game.cards.CardBack;
import org.luxons.sevenwonders.game.cards.Color;
import org.luxons.sevenwonders.game.test.TestUtils;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
@RunWith(Theories.class)
public class BonusPerBoardElementTest {
@@ -65,7 +65,8 @@ public class BonusPerBoardElementTest {
}
@Theory
- public void computePoints_countsDefeatTokens(RelativeBoardPosition boardPosition, int nbDefeatTokens, int points, int gold) {
+ public void computePoints_countsDefeatTokens(RelativeBoardPosition boardPosition, int nbDefeatTokens, int points,
+ int gold) {
Board board = table.getBoard(0, boardPosition);
for (int i = 0; i < nbDefeatTokens; i++) {
board.getMilitary().defeat();
@@ -78,7 +79,8 @@ public class BonusPerBoardElementTest {
}
@Theory
- public void computePoints_countsWonderStages(RelativeBoardPosition boardPosition, int nbStages, int points, int gold) {
+ public void computePoints_countsWonderStages(RelativeBoardPosition boardPosition, int nbStages, int points,
+ int gold) {
Board board = table.getBoard(0, boardPosition);
for (int i = 0; i < nbStages; i++) {
board.getWonder().buildLevel(new CardBack(""));
@@ -91,8 +93,8 @@ public class BonusPerBoardElementTest {
}
@Theory
- public void apply_countsCards(RelativeBoardPosition boardPosition, int nbCards, int nbOtherCards,
- int points, int gold, Color color) {
+ public void apply_countsCards(RelativeBoardPosition boardPosition, int nbCards, int nbOtherCards, int points,
+ int gold, Color color) {
Board board = table.getBoard(0, boardPosition);
TestUtils.addCards(board, nbCards, nbOtherCards, color);
@@ -106,7 +108,8 @@ public class BonusPerBoardElementTest {
}
@Theory
- public void apply_countsDefeatTokens(RelativeBoardPosition boardPosition, int nbDefeatTokens, int points, int gold) {
+ public void apply_countsDefeatTokens(RelativeBoardPosition boardPosition, int nbDefeatTokens, int points,
+ int gold) {
Board board = table.getBoard(0, boardPosition);
for (int i = 0; i < nbDefeatTokens; i++) {
board.getMilitary().defeat();
@@ -136,4 +139,4 @@ public class BonusPerBoardElementTest {
bonus.apply(table, 0);
assertEquals(initialGold + nbStages * gold, selfBoard.getGold());
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/effects/DiscountTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/effects/DiscountTest.java
index cf8ce21d..c6819d3a 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/effects/DiscountTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/effects/DiscountTest.java
@@ -18,7 +18,7 @@ public class DiscountTest {
@DataPoints
public static int[] discountedPrices() {
- return new int[]{0, 1, 2};
+ return new int[] {0, 1, 2};
}
@DataPoints
@@ -46,7 +46,7 @@ public class DiscountTest {
@Theory
public void apply_doesNotAffectOtherResources(int discountedPrice, ResourceType discountedType, Provider provider,
- ResourceType otherType, Provider otherProvider) {
+ ResourceType otherType, Provider otherProvider) {
Assume.assumeTrue(otherProvider != provider);
Assume.assumeTrue(otherType != discountedType);
@@ -69,4 +69,4 @@ public class DiscountTest {
BoughtResources fromOtherProviderAndType = TestUtils.createBoughtResources(otherProvider, otherType);
assertEquals(normalPrice, board.getTradingRules().computeCost(fromOtherProviderAndType));
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/effects/GoldIncreaseTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/effects/GoldIncreaseTest.java
index e4d4c27f..be124251 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/effects/GoldIncreaseTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/effects/GoldIncreaseTest.java
@@ -9,14 +9,16 @@ import org.luxons.sevenwonders.game.boards.Board;
import org.luxons.sevenwonders.game.resources.ResourceType;
import org.luxons.sevenwonders.game.test.TestUtils;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
@RunWith(Theories.class)
public class GoldIncreaseTest {
@DataPoints
public static int[] goldAmounts() {
- return new int[]{-5, -1, 0, 1, 2, 5, 10};
+ return new int[] {-5, -1, 0, 1, 2, 5, 10};
}
@DataPoints
@@ -75,4 +77,4 @@ public class GoldIncreaseTest {
GoldIncrease goldIncrease2 = new GoldIncrease(gold);
assertEquals(goldIncrease1.hashCode(), goldIncrease2.hashCode());
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/effects/MilitaryReinforcementsTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/effects/MilitaryReinforcementsTest.java
index d3c2cc03..478af746 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/effects/MilitaryReinforcementsTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/effects/MilitaryReinforcementsTest.java
@@ -9,14 +9,16 @@ import org.luxons.sevenwonders.game.boards.Board;
import org.luxons.sevenwonders.game.resources.ResourceType;
import org.luxons.sevenwonders.game.test.TestUtils;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
@RunWith(Theories.class)
public class MilitaryReinforcementsTest {
@DataPoints
public static int[] shieldCounts() {
- return new int[]{0, 1, 2, 3, 5};
+ return new int[] {0, 1, 2, 3, 5};
}
@DataPoints
@@ -76,4 +78,4 @@ public class MilitaryReinforcementsTest {
MilitaryReinforcements reinforcements2 = new MilitaryReinforcements(shields);
assertEquals(reinforcements1.hashCode(), reinforcements2.hashCode());
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/effects/ProductionIncreaseTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/effects/ProductionIncreaseTest.java
index d19f6288..b6a47292 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/effects/ProductionIncreaseTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/effects/ProductionIncreaseTest.java
@@ -11,7 +11,9 @@ import org.luxons.sevenwonders.game.resources.ResourceType;
import org.luxons.sevenwonders.game.resources.Resources;
import org.luxons.sevenwonders.game.test.TestUtils;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
@RunWith(Theories.class)
public class ProductionIncreaseTest {
@@ -104,4 +106,4 @@ public class ProductionIncreaseTest {
ProductionIncrease effect2 = createProductionIncrease(addedType);
assertEquals(effect1.hashCode(), effect2.hashCode());
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/effects/RawPointsIncreaseTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/effects/RawPointsIncreaseTest.java
index a1c8a8de..020eda73 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/effects/RawPointsIncreaseTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/effects/RawPointsIncreaseTest.java
@@ -7,7 +7,9 @@ import org.junit.runner.RunWith;
import org.luxons.sevenwonders.game.api.Table;
import org.luxons.sevenwonders.game.test.TestUtils;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
@RunWith(Theories.class)
public class RawPointsIncreaseTest {
@@ -58,4 +60,4 @@ public class RawPointsIncreaseTest {
RawPointsIncrease rawPointsIncrease2 = new RawPointsIncrease(points);
assertEquals(rawPointsIncrease1.hashCode(), rawPointsIncrease2.hashCode());
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/effects/ScienceProgressTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/effects/ScienceProgressTest.java
index 56289654..b5402a7e 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/effects/ScienceProgressTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/effects/ScienceProgressTest.java
@@ -10,7 +10,7 @@ import org.luxons.sevenwonders.game.boards.ScienceType;
import org.luxons.sevenwonders.game.resources.ResourceType;
import org.luxons.sevenwonders.game.test.TestUtils;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
@RunWith(Theories.class)
public class ScienceProgressTest {
@@ -35,4 +35,4 @@ public class ScienceProgressTest {
assertEquals(initTablets + tablets, board.getScience().getQuantity(ScienceType.TABLET));
assertEquals(initJokers + jokers, board.getScience().getJokers());
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/effects/SpecialAbilityActivationTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/effects/SpecialAbilityActivationTest.java
index b04db127..0f30a3a5 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/effects/SpecialAbilityActivationTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/effects/SpecialAbilityActivationTest.java
@@ -29,7 +29,7 @@ public class SpecialAbilityActivationTest {
@DataPoints
public static RelativeBoardPosition[] neighbours() {
- return new RelativeBoardPosition[]{RelativeBoardPosition.LEFT, RelativeBoardPosition.RIGHT};
+ return new RelativeBoardPosition[] {RelativeBoardPosition.LEFT, RelativeBoardPosition.RIGHT};
}
@DataPoints
@@ -46,7 +46,7 @@ public class SpecialAbilityActivationTest {
Arrays.asList(RelativeBoardPosition.LEFT, RelativeBoardPosition.SELF, RelativeBoardPosition.RIGHT));
bonus2.setPoints(1);
- return new Card[]{TestUtils.createGuildCard(1, bonus), TestUtils.createGuildCard(2, bonus2)};
+ return new Card[] {TestUtils.createGuildCard(1, bonus), TestUtils.createGuildCard(2, bonus2)};
}
@Theory
@@ -91,4 +91,4 @@ public class SpecialAbilityActivationTest {
Table table = TestUtils.createTable(5);
effect.computePoints(table, 0);
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/resources/ProductionTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/resources/ProductionTest.java
index 76d2345f..c54209c1 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/resources/ProductionTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/resources/ProductionTest.java
@@ -3,7 +3,9 @@ package org.luxons.sevenwonders.game.resources;
import org.junit.Before;
import org.junit.Test;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
public class ProductionTest {
@@ -268,4 +270,4 @@ public class ProductionTest {
production2.addChoice(ResourceType.ORE, ResourceType.WOOD);
assertEquals(production1.hashCode(), production2.hashCode());
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/resources/ResourcesTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/resources/ResourcesTest.java
index 674c90e7..cd352c8b 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/resources/ResourcesTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/resources/ResourcesTest.java
@@ -428,4 +428,4 @@ public class ResourcesTest {
resources2.add(ResourceType.GLASS, 1);
assertEquals(resources1.hashCode(), resources2.hashCode());
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/resources/TradingRulesTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/resources/TradingRulesTest.java
index cd6661dc..00400e7c 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/resources/TradingRulesTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/resources/TradingRulesTest.java
@@ -10,8 +10,8 @@ import org.junit.experimental.theories.Theory;
import org.junit.runner.RunWith;
import org.luxons.sevenwonders.game.test.TestUtils;
-import static org.junit.Assert.*;
-import static org.junit.Assume.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assume.assumeTrue;
@RunWith(Theories.class)
public class TradingRulesTest {
@@ -93,4 +93,4 @@ public class TradingRulesTest {
assertEquals(defaultCost + overriddenCost, rules.computeCost(boughtResources));
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/lobby/LobbyTest.java b/backend/src/test/java/org/luxons/sevenwonders/lobby/LobbyTest.java
index adc37d3d..c47e30b4 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/lobby/LobbyTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/lobby/LobbyTest.java
@@ -178,4 +178,4 @@ public class LobbyTest {
lobby.startGame();
assertTrue(lobby.getState() == State.PLAYING);
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/repositories/LobbyRepositoryTest.java b/backend/src/test/java/org/luxons/sevenwonders/repositories/LobbyRepositoryTest.java
index 35618d49..4ba7d6e3 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/repositories/LobbyRepositoryTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/repositories/LobbyRepositoryTest.java
@@ -2,9 +2,9 @@ package org.luxons.sevenwonders.repositories;
import org.junit.Before;
import org.junit.Test;
+import org.luxons.sevenwonders.game.data.GameDefinitionLoader;
import org.luxons.sevenwonders.lobby.Lobby;
import org.luxons.sevenwonders.lobby.Player;
-import org.luxons.sevenwonders.game.data.GameDefinitionLoader;
import org.luxons.sevenwonders.repositories.LobbyRepository.LobbyNotFoundException;
import static org.junit.Assert.assertNotNull;
@@ -74,4 +74,4 @@ public class LobbyRepositoryTest {
// the lobby has been properly removed
}
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/repositories/PlayerRepositoryTest.java b/backend/src/test/java/org/luxons/sevenwonders/repositories/PlayerRepositoryTest.java
index 8a6efe8c..95fd80fd 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/repositories/PlayerRepositoryTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/repositories/PlayerRepositoryTest.java
@@ -70,4 +70,4 @@ public class PlayerRepositoryTest {
repository.remove("player1");
assertFalse(repository.contains("player1"));
}
-} \ No newline at end of file
+}
diff --git a/backend/src/test/java/org/luxons/sevenwonders/validation/DestinationAccessValidatorTest.java b/backend/src/test/java/org/luxons/sevenwonders/validation/DestinationAccessValidatorTest.java
index 8623ead8..bdf6c8c9 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/validation/DestinationAccessValidatorTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/validation/DestinationAccessValidatorTest.java
@@ -2,9 +2,9 @@ package org.luxons.sevenwonders.validation;
import org.junit.Before;
import org.junit.Test;
+import org.luxons.sevenwonders.game.data.GameDefinitionLoader;
import org.luxons.sevenwonders.lobby.Lobby;
import org.luxons.sevenwonders.lobby.Player;
-import org.luxons.sevenwonders.game.data.GameDefinitionLoader;
import org.luxons.sevenwonders.repositories.LobbyRepository;
import org.luxons.sevenwonders.repositories.LobbyRepository.LobbyNotFoundException;
@@ -138,4 +138,4 @@ public class DestinationAccessValidatorTest {
assertTrue(destinationAccessValidator.hasAccess("user6", "/game/1"));
}
-} \ No newline at end of file
+}
bgstack15