Browse Source

add delete player method to AccessClient and test

feat-loginClient
Steffen Nitschke 4 years ago
parent
commit
e777c9ffb1
  1. 3
      fh.fd.ci.client/src/main/java/de/fd/fh/network/AccessClient.java
  2. 10
      fh.fd.ci.client/src/test/java/de/fd/fh/network/AccessClientTest.java

3
fh.fd.ci.client/src/main/java/de/fd/fh/network/AccessClient.java

@ -20,4 +20,7 @@ public interface AccessClient
@RequestLine("POST /accounts/logout") @RequestLine("POST /accounts/logout")
@Headers(Utils.AUTHENTICATION_HEADER + ":Bearer {authToken}") @Headers(Utils.AUTHENTICATION_HEADER + ":Bearer {authToken}")
Response logout(@Param("authToken") final String authenticationHeader); Response logout(@Param("authToken") final String authenticationHeader);
@RequestLine("DELETE /accounts/{playerId}")
Response deletePlayer(@Param("playerId") final String playerId);
} }

10
fh.fd.ci.client/src/test/java/de/fd/fh/network/AccessClientTest.java

@ -83,4 +83,14 @@ class AccessClientTest
assertEquals(200, result.status(), "Should return status code 200."); assertEquals(200, result.status(), "Should return status code 200.");
} }
@Test
void testDeletePlayer()
{
mockClient.ok(HttpMethod.DELETE, "/accounts/12345");
final Response result = client.deletePlayer("12345");
assertEquals(200, result.status(), "Should return status code 200.");
}
} }
Loading…
Cancel
Save