Browse Source

add findRunningGamesOfUser to ServerAppTest

feat-serverGameRepresentation
Steffen Nitschke 4 years ago
parent
commit
8f460b2f41
  1. 16
      fh.fd.ci.server/src/test/java/de/fd/fh/ServerAppTest.java

16
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).should().findGameById(any(), any());
then(gameController).shouldHaveNoMoreInteractions(); 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<String> res = new ApiTestUtils<String>()
.request("GET", url, null, null, String.class);
assertNotNull(res);
assertEquals(200, res.getStatus());
then(gameController).should().findRunningGamesOfUser(any(), any());
then(gameController).shouldHaveNoMoreInteractions();
}
} }
Loading…
Cancel
Save