|
@ -77,4 +77,16 @@ class GameServiceTest |
|
|
then(repository).should().save(any(Game.class)); |
|
|
then(repository).should().save(any(Game.class)); |
|
|
then(repository).shouldHaveNoMoreInteractions(); |
|
|
then(repository).shouldHaveNoMoreInteractions(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void given_storedGame_when_findGameById_should_returnGame() |
|
|
|
|
|
{ |
|
|
|
|
|
final GameRepository repository = when(mock(GameRepository.class).findByGameId(any(GameId.class))) |
|
|
|
|
|
.thenReturn(new Game(null, null, null, null, null, null)) |
|
|
|
|
|
.getMock(); |
|
|
|
|
|
|
|
|
|
|
|
final Game result = new GameService(repository).findGameById(GameId.of("12345")); |
|
|
|
|
|
|
|
|
|
|
|
assertNotNull(result); |
|
|
|
|
|
} |
|
|
} |
|
|
} |