| 1 | package org.hplr.tournament.core.usecases.service; | |
| 2 | ||
| 3 | import lombok.RequiredArgsConstructor; | |
| 4 | import org.hplr.tournament.core.model.Tournament; | |
| 5 | import org.hplr.tournament.core.model.TournamentSnapshot; | |
| 6 | import org.hplr.tournament.core.usecases.port.dto.TournamentSelectDto; | |
| 7 | import org.hplr.tournament.core.usecases.port.in.GetTournamentUseCaseInterface; | |
| 8 | import org.hplr.tournament.core.usecases.port.out.query.SelectTournamentByTournamentIdQueryInterface; | |
| 9 | import org.springframework.stereotype.Service; | |
| 10 | ||
| 11 | import java.util.NoSuchElementException; | |
| 12 | import java.util.Optional; | |
| 13 | import java.util.UUID; | |
| 14 | ||
| 15 | @Service | |
| 16 | @RequiredArgsConstructor | |
| 17 | public class GetTournamentUseCaseService implements GetTournamentUseCaseInterface { | |
| 18 | ||
| 19 | private final SelectTournamentByTournamentIdQueryInterface selectTournamentByTournamentIdQueryInterface; | |
| 20 | ||
| 21 | @Override | |
| 22 | public TournamentSnapshot getTournament(UUID tournamentId) { | |
| 23 | Optional<TournamentSelectDto> tournamentSelectDto = selectTournamentByTournamentIdQueryInterface | |
| 24 | .selectTournamentByTournamentId(tournamentId); | |
| 25 | Tournament tournament = Tournament.fromSelectDto(tournamentSelectDto.orElseThrow(NoSuchElementException::new)); | |
| 26 |
1
1. getTournament : replaced return value with null for org/hplr/tournament/core/usecases/service/GetTournamentUseCaseService::getTournament → KILLED |
return tournament.toSnapshot(); |
| 27 | } | |
| 28 | } | |
Mutations | ||
| 26 |
1.1 |