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

documentation for reset password API calls

parent 9511d42a
......@@ -118,3 +118,17 @@ include::{snippets}/user/update_user/curl-request.adoc[]
=== Path Parameters
include::{snippets}/user/update_user/path-parameters.adoc[]
== Request password reset over email
=== CURL sample
include::{snippets}/user/request_reset_password/curl-request.adoc[]
=== Path Parameters
include::{snippets}/user/request_reset_password/path-parameters.adoc[]
== Reset password using token obtained over email
=== CURL sample
include::{snippets}/user/reset_password/curl-request.adoc[]
=== Request Parameters
include::{snippets}/user/reset_password/request-parameters.adoc[]
......@@ -522,7 +522,7 @@ public class UserControllerIntegrationTest extends ControllerIntegrationTest {
RequestBuilder grantRequest = post("/users/{login}:requestResetPassword", BUILT_IN_TEST_ADMIN_LOGIN);
mockMvc.perform(grantRequest)
.andDo(document("user/reset_password",
.andDo(document("user/request_reset_password",
pathParameters(parameterWithName("login").description("user login"))))
.andExpect(status().is2xxSuccessful());
assertEquals(count + 1, resetPasswordTokenDao.getCount());
......@@ -618,6 +618,14 @@ public class UserControllerIntegrationTest extends ControllerIntegrationTest {
.contentType(MediaType.APPLICATION_FORM_URLENCODED);
mockMvc.perform(resetRequest)
.andDo(document("user/reset_password",
requestParameters(
parameterWithName("password")
.optional()
.description("new password"),
parameterWithName("token")
.optional()
.description("reset poassowrd token obtained using email"))))
.andExpect(status().is2xxSuccessful());
createSession(BUILT_IN_TEST_ADMIN_LOGIN, newPassword);
......
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