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);
}
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);
}