Browse Source

add findGameById-Test

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

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

@ -77,4 +77,16 @@ class GameServiceTest
then(repository).should().save(any(Game.class));
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);
}
}
Loading…
Cancel
Save