Commit f5eb641f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

information about isSessionValid API call is autogenerated

parent 7926c81c
......@@ -24,3 +24,19 @@ include::{snippets}/authentication/login/http-request.adoc[]
==== Sample Response
include::{snippets}/authentication/login/http-response.adoc[]
=== Check if session is still valid
Sometimes there is need for verification if user is authenticated in the current session (for instance we might need this information to check if our session did not expire). This API call returns information if the session is still valid.
==== CURL sample
include::{snippets}/authentication/isSessionValid/curl-request.adoc[]
==== Response Fields
include::{snippets}/authentication/isSessionValid/response-fields.adoc[]
==== Sample Request
include::{snippets}/authentication/isSessionValid/http-request.adoc[]
==== Sample Response
include::{snippets}/authentication/isSessionValid/http-response.adoc[]
......@@ -103,7 +103,12 @@ public class UserControllerAnonymousIntegrationTest extends ControllerIntegratio
String response = mockMvc.perform(request)
.andExpect(status().is2xxSuccessful())
.andDo(document("authentication/isSessionValid",
responseFields(
fieldWithPath("login")
.description("user login of the session owner"))))
.andReturn().getResponse().getContentAsString();
String login = new JsonParser()
.parse(response)
.getAsJsonObject()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment