(Move move)
| 19 | private final GameModel gameModel = new GameModel(); |
| 20 | |
| 21 | public void saveMove(Move move) throws SessionNotFoundException, GameNotFoundException { |
| 22 | // check session |
| 23 | String sessionId = move.getSession(); |
| 24 | String gameId = move.getGame(); |
| 25 | if (sessionModel.loadSession(sessionId) == null ) { |
| 26 | throw new SessionNotFoundException(sessionId); |
| 27 | } |
| 28 | if (gameModel.loadGame(gameId) == null ) { |
| 29 | throw new GameNotFoundException(gameId); |
| 30 | } |
| 31 | mapper.save(move); |
| 32 | } |
| 33 | |
| 34 | public Move loadMove(String moveId) throws MoveNotFoundException { |
| 35 | Move move = mapper.load(Move.class, moveId); |
no test coverage detected