|
|
@ -8,6 +8,7 @@ import de.fd.fh.shared.Utils; |
|
|
|
import org.junit.jupiter.api.AfterAll; |
|
|
|
import org.junit.jupiter.api.BeforeAll; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
import spark.Response; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.util.HashMap; |
|
|
@ -100,4 +101,21 @@ class ServerAppTest |
|
|
|
assertEquals(200, res.getStatus()); |
|
|
|
then(accessController).should().logout(any(), any()); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
void testDeletePlayer() |
|
|
|
{ |
|
|
|
final Response response = mock(Response.class); |
|
|
|
|
|
|
|
when(accessController.deletePlayer(any(), any())).thenReturn(response); |
|
|
|
|
|
|
|
String url = "/accounts/12345"; |
|
|
|
|
|
|
|
ApiTestUtils.TestResponse<String> res = new ApiTestUtils<String>() |
|
|
|
.request("DELETE", url, null, null, String.class); |
|
|
|
|
|
|
|
assertNotNull(res); |
|
|
|
assertEquals(200, res.getStatus()); |
|
|
|
then(accessController).should().deletePlayer(any(), any()); |
|
|
|
} |
|
|
|
} |