Browse Source

better createGameTest

feat-serverGameRepresentation
Steffen Nitschke 4 years ago
parent
commit
39685163a2
  1. 3
      fh.fd.ci.server/src/test/java/de/fd/fh/server/game/GameServiceTest.java

3
fh.fd.ci.server/src/test/java/de/fd/fh/server/game/GameServiceTest.java

@ -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());
} }
} }
Loading…
Cancel
Save