Search in sources :

Example 96 with Game

use of com.faforever.server.entity.Game in project faf-java-server by FAForever.

the class ArmyStatisticsServiceTest method setUp.

@Before
@SuppressWarnings("unchecked")
public void setUp() {
    instance = new ArmyStatisticsService(achievementService, eventService, clientService, modService);
    player = new Player();
    player.setLogin("TestUser");
    player.setId(42);
    game = new Game();
    game.setId(1);
    unitStats = new ArmyStatistics.CategoryStats().setAir(new ArmyStatistics.UnitStats()).setLand(new ArmyStatistics.UnitStats()).setNaval(new ArmyStatistics.UnitStats()).setExperimental(new ArmyStatistics.UnitStats()).setCdr(new ArmyStatistics.UnitStats()).setTech1(new ArmyStatistics.UnitStats()).setTech2(new ArmyStatistics.UnitStats()).setTech3(new ArmyStatistics.UnitStats()).setEngineer(new ArmyStatistics.UnitStats()).setTransportation(new ArmyStatistics.UnitStats()).setSacu(new ArmyStatistics.UnitStats());
    achievementUpdates = new ArrayList<>();
    eventUpdates = new ArrayList<>();
    doAnswer(invocation -> {
        achievementUpdates.addAll((Collection<? extends AchievementUpdate>) invocation.getArguments()[0]);
        return CompletableFuture.completedFuture(null);
    }).when(achievementService).executeBatchUpdate(any());
    doAnswer(invocation -> {
        eventUpdates.addAll((Collection<? extends EventUpdate>) invocation.getArguments()[0]);
        return CompletableFuture.completedFuture(null);
    }).when(eventService).executeBatchUpdate(any());
}
Also used : Player(com.faforever.server.entity.Player) Game(com.faforever.server.entity.Game) Before(org.junit.Before)

Aggregations

Game (com.faforever.server.entity.Game)96 Test (org.junit.Test)71 Player (com.faforever.server.entity.Player)26 FeaturedMod (com.faforever.server.entity.FeaturedMod)15 ModVersion (com.faforever.server.entity.ModVersion)12 ConnectionAware (com.faforever.server.client.ConnectionAware)11 Ladder1v1Rating (com.faforever.server.entity.Ladder1v1Rating)11 List (java.util.List)11 ClientService (com.faforever.server.client.ClientService)10 ServerProperties (com.faforever.server.config.ServerProperties)10 RequestException (com.faforever.server.error.RequestException)10 ModService (com.faforever.server.mod.ModService)10 VisibleForTesting (com.google.common.annotations.VisibleForTesting)10 Duration (java.time.Duration)10 Map (java.util.Map)10 Optional (java.util.Optional)10 Slf4j (lombok.extern.slf4j.Slf4j)10 Service (org.springframework.stereotype.Service)10 ArmyResult (com.faforever.server.entity.ArmyResult)9 GamePlayerStats (com.faforever.server.entity.GamePlayerStats)9