Search in sources :

Example 1 with Map

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

the class MapServiceTest method timesPlayedIsIncreasedCorrectly.

@Test
public void timesPlayedIsIncreasedCorrectly() {
    Map map = new Map().setId(1);
    MapStats features = instance.getMapStats(map);
    assertThat(features.getId(), is(1));
    assertThat(features.getTimesPlayed(), is(41));
    instance.incrementTimesPlayed(map);
    verify(mapStatsRepository).save(features);
    features = instance.getMapStats(map);
    assertThat(features.getId(), is(1));
    assertThat(features.getTimesPlayed(), is(42));
    verifyZeroInteractions(mapVersionRepository);
    verifyZeroInteractions(ladder1v1MapRepository);
}
Also used : Map(com.faforever.server.entity.Map) MapStats(com.faforever.server.entity.MapStats) Test(org.junit.Test)

Example 2 with Map

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

the class MapServiceTest method timesPlayedIsInitializedWithZero.

@Test
public void timesPlayedIsInitializedWithZero() {
    int newId = 1342342;
    Map map = new Map().setId(newId);
    MapStats features = instance.getMapStats(map);
    assertThat(features.getId(), is(newId));
    assertThat(features.getTimesPlayed(), is(0));
    verify(mapStatsRepository).save(features);
    verifyZeroInteractions(mapVersionRepository);
    verifyZeroInteractions(ladder1v1MapRepository);
}
Also used : Map(com.faforever.server.entity.Map) MapStats(com.faforever.server.entity.MapStats) Test(org.junit.Test)

Aggregations

Map (com.faforever.server.entity.Map)2 MapStats (com.faforever.server.entity.MapStats)2 Test (org.junit.Test)2