diff --git a/fh.fd.ci.client/src/main/java/de/fd/fh/network/AccessClient.java b/fh.fd.ci.client/src/main/java/de/fd/fh/network/AccessClient.java index 6ce4d47..77db09a 100644 --- a/fh.fd.ci.client/src/main/java/de/fd/fh/network/AccessClient.java +++ b/fh.fd.ci.client/src/main/java/de/fd/fh/network/AccessClient.java @@ -16,4 +16,8 @@ public interface AccessClient @RequestLine("POST /accounts/login") @Headers(Utils.AUTHENTICATION_HEADER + ":Basic {authToken}") LoginResponse login(@Param("authToken") final String authenticationHeader); + + @RequestLine("POST /accounts/logout") + @Headers(Utils.AUTHENTICATION_HEADER + ":Bearer {authToken}") + Response logout(@Param("authToken") final String authenticationHeader); } diff --git a/fh.fd.ci.client/src/test/java/de/fd/fh/network/AccessClientTest.java b/fh.fd.ci.client/src/test/java/de/fd/fh/network/AccessClientTest.java index 7080233..74cc629 100644 --- a/fh.fd.ci.client/src/test/java/de/fd/fh/network/AccessClientTest.java +++ b/fh.fd.ci.client/src/test/java/de/fd/fh/network/AccessClientTest.java @@ -73,4 +73,14 @@ class AccessClientTest assertEquals("Basic testToken", authHeader, "Should use given token."); } + + @Test + void testLogout() + { + mockClient.ok(HttpMethod.POST, "/accounts/logout"); + + final Response result = client.logout("testToken"); + + assertEquals(200, result.status(), "Should return status code 200."); + } } \ No newline at end of file