You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In game entity fields playerStates and field has annotation @OrderBy. If insert and read game using controllers, this fields will be sorted. But in test it doesn't work
@Before
@Transactional
public void insert(){
Player john = new Player("john");
Player ivan = new Player("ivan");
Player alisa = new Player("alisa");
Player bot = new Player("bot");
List<Player> players = Arrays.asList(john, ivan, alisa, bot);
List<CellState> cellStates = Arrays.asList(new CellState(2), new CellState(1),
new CellState(0), new CellState(3));
List<PlayerState> playerStates = Arrays.asList(new PlayerState(200, 0, john),
new PlayerState(200, 2, alisa),
new PlayerState(200, 1, ivan),
new PlayerState(200, 3, bot));
List<Game> games = Arrays.asList(new Game(playerStates, john, cellStates),
new Game(playerStates, alisa, cellStates));
playerRepository.saveAll(players);
gameRepository.saveAll(games);
}
In game entity fields
playerStates
andfield
has annotation@OrderBy
. If insert and read game using controllers, this fields will be sorted. But in test it doesn't workAnd get next output:
The text was updated successfully, but these errors were encountered: