|
@ -14,7 +14,7 @@ class GameServiceTest |
|
|
void testCreateGame() |
|
|
void testCreateGame() |
|
|
{ |
|
|
{ |
|
|
final GameRepository repository = when(mock(GameRepository.class).save(any())) |
|
|
final GameRepository repository = when(mock(GameRepository.class).save(any())) |
|
|
.thenReturn(new Key<>(Game.class, "testCollection", GameId.random())) |
|
|
|
|
|
|
|
|
.thenReturn(new Key<>(Game.class, "testCollection", GameId.of("98765"))) |
|
|
.getMock(); |
|
|
.getMock(); |
|
|
|
|
|
|
|
|
final Game game = new Game(); |
|
|
final Game game = new Game(); |
|
@ -22,5 +22,6 @@ class GameServiceTest |
|
|
final GameId result = new GameService(repository).createGame(game); |
|
|
final GameId result = new GameService(repository).createGame(game); |
|
|
|
|
|
|
|
|
assertNotNull(result); |
|
|
assertNotNull(result); |
|
|
|
|
|
assertEquals("98765", result.getIdentifier()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |