1 | package org.hplr.game.core.usecases.service; | |
2 | ||
3 | import lombok.RequiredArgsConstructor; | |
4 | ||
5 | import org.hplr.game.core.model.Game; | |
6 | import org.hplr.game.core.model.GameSnapshot; | |
7 | import org.hplr.game.core.model.GameValidator; | |
8 | import org.hplr.game.core.usecases.port.dto.GameSelectDto; | |
9 | import org.hplr.game.core.usecases.port.in.StartGameManualUseCaseInterface; | |
10 | import org.hplr.game.core.usecases.port.out.command.StartGameCommandInterface; | |
11 | import org.hplr.game.core.usecases.port.out.query.SelectGameByGameIdQueryInterface; | |
12 | ||
13 | import org.springframework.stereotype.Service; | |
14 | ||
15 | import java.util.NoSuchElementException; | |
16 | import java.util.Optional; | |
17 | import java.util.UUID; | |
18 | ||
19 | @Service | |
20 | @RequiredArgsConstructor | |
21 | public class StartGameManualUseCaseService implements StartGameManualUseCaseInterface { | |
22 | ||
23 | private final SelectGameByGameIdQueryInterface selectGameByGameIdQueryInterface; | |
24 | private final StartGameCommandInterface startGameCommandInterface; | |
25 | @Override | |
26 | public UUID startGameManual(UUID gameId) { | |
27 | Optional<GameSelectDto> gameSelectDto = selectGameByGameIdQueryInterface.selectGameByGameId(gameId); | |
28 |
1
1. lambda$startGameManual$0 : replaced return value with null for org/hplr/game/core/usecases/service/StartGameManualUseCaseService::lambda$startGameManual$0 → KILLED |
Game game = gameSelectDto.map(Game::fromDto).orElseThrow(() -> new NoSuchElementException("Game not found!")); |
29 |
1
1. startGameManual : removed call to org/hplr/game/core/model/GameValidator::validateStartingGame → KILLED |
GameValidator.validateStartingGame(game); |
30 | GameSnapshot gameSnapshot = game.toSnapshot(); | |
31 |
1
1. startGameManual : removed call to org/hplr/game/core/usecases/port/out/command/StartGameCommandInterface::startGame → KILLED |
startGameCommandInterface.startGame(gameSnapshot); |
32 |
1
1. startGameManual : replaced return value with null for org/hplr/game/core/usecases/service/StartGameManualUseCaseService::startGameManual → KILLED |
return gameSnapshot.gameId().gameId(); |
33 | } | |
34 | } | |
Mutations | ||
28 |
1.1 |
|
29 |
1.1 |
|
31 |
1.1 |
|
32 |
1.1 |