diff --git a/fh.fd.ci.server/src/test/java/de/fd/fh/ServerAppTest.java b/fh.fd.ci.server/src/test/java/de/fd/fh/ServerAppTest.java index 1a9934d..0422115 100644 --- a/fh.fd.ci.server/src/test/java/de/fd/fh/ServerAppTest.java +++ b/fh.fd.ci.server/src/test/java/de/fd/fh/ServerAppTest.java @@ -197,4 +197,20 @@ class ServerAppTest then(gameController).should().findGameById(any(), any()); then(gameController).shouldHaveNoMoreInteractions(); } + + @Test + void testFindRunningGamesOfUser() throws JsonProcessingException + { + when(gameController.findRunningGamesOfUser(any(), any())).thenReturn(mock(Response.class)); + + final String url = "/games/findByUser/12345"; + + ApiTestUtils.TestResponse res = new ApiTestUtils() + .request("GET", url, null, null, String.class); + + assertNotNull(res); + assertEquals(200, res.getStatus()); + then(gameController).should().findRunningGamesOfUser(any(), any()); + then(gameController).shouldHaveNoMoreInteractions(); + } } \ No newline at end of file