Search in sources :

Example 6 with PlayerDivisionInfo

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

the class DivisionServiceTest method testGetCurrentPlayerDivisionForInvalidScore.

@Test(expected = IllegalStateException.class)
public void testGetCurrentPlayerDivisionForInvalidScore() throws Exception {
    PlayerDivisionInfo info = new PlayerDivisionInfo();
    info.setPlayer(player1);
    info.setLeague(1);
    info.setScore(99999);
    when(playerDivisionInfoRepository.findByPlayerAndSeason(player1, serverProperties.getLadder1v1().getSeason())).thenReturn(info);
    instance.getCurrentPlayerDivision(player1);
}
Also used : PlayerDivisionInfo(com.faforever.server.entity.PlayerDivisionInfo) Test(org.junit.Test)

Aggregations

PlayerDivisionInfo (com.faforever.server.entity.PlayerDivisionInfo)6 Division (com.faforever.server.entity.Division)3 ServerProperties (com.faforever.server.config.ServerProperties)2 Transactional (javax.transaction.Transactional)2 NotNull (org.jetbrains.annotations.NotNull)2 Player (com.faforever.server.entity.Player)1 ImmutableList (com.google.common.collect.ImmutableList)1 TestWith (com.googlecode.zohhak.api.TestWith)1 MessageFormat (java.text.MessageFormat)1 Objects (java.util.Objects)1 Optional (java.util.Optional)1 PostConstruct (javax.annotation.PostConstruct)1 Inject (javax.inject.Inject)1 Getter (lombok.Getter)1 Slf4j (lombok.extern.slf4j.Slf4j)1 Nullable (org.jetbrains.annotations.Nullable)1 Before (org.junit.Before)1 Test (org.junit.Test)1 Service (org.springframework.stereotype.Service)1