Closed lafkob closed 8 years ago
I wrote a unit test just now for the scenario and it appears to be working correctly. The board is immutable - did you assign it to a new board before you stored the status? (In fact, we should make sure you do that every time you update and store the board.)
Ooops you're right, I forgot those GameBoards are immutable. I will have to go back through everywhere and reassign them after calling operations. Good call!
Hah, I only know because I did it so many times myself. One of the disadvantages of having immutable classes. : /
I think I fixed this. FindBugs pointed out all the places it could see where the methods returned something but we didn't use it. Try testing it though.
Using the test UI, I started a new game then entered the game id in and hit quit game. The result was a success but the database still has the state as WAITING_FOR_PLAYER_2. I think the playerQuit() method needs to be double checked to make sure it changes the game status accordingly? The audit table record was written correctly that the game was quit, so the REST method was successful.