Browse Source

add findGameByIdTest to ServerAppTest

feat-serverGameRepresentation
Steffen Nitschke 3 years ago
parent
commit
cc25b95e9b
  1. 17
      fh.fd.ci.server/src/test/java/de/fd/fh/ServerAppTest.java

17
fh.fd.ci.server/src/test/java/de/fd/fh/ServerAppTest.java

@ -179,5 +179,22 @@ class ServerAppTest
assertNotNull(res);
assertEquals(200, res.getStatus());
then(gameController).should().createGame(any(), any());
then(gameController).shouldHaveNoMoreInteractions();
}
@Test
void testFindGameById() throws JsonProcessingException
{
when(gameController.findGameById(any(), any())).thenReturn(mock(Response.class));
final String url = "/games/12345";
ApiTestUtils.TestResponse<String> res = new ApiTestUtils<String>()
.request("GET", url, null, null, String.class);
assertNotNull(res);
assertEquals(200, res.getStatus());
then(gameController).should().findGameById(any(), any());
then(gameController).shouldHaveNoMoreInteractions();
}
}
Loading…
Cancel
Save