Skip to content

Commit

Permalink
#21446 IT failure ResetPasswordResourceIntegrationTest#test_resetPass…
Browse files Browse the repository at this point in the history
…word_success
  • Loading branch information
erickgonzalez authored Jan 31, 2022
1 parent 62bfcf1 commit 373d7fe
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
public class ResetPasswordResourceIntegrationTest{

static ResetPasswordResource resource;
private final String newPassword = "n3wP@ssworD";

@BeforeClass
public static void prepare() throws Exception{
Expand Down Expand Up @@ -67,7 +68,7 @@ public void test_resetPassword_success() throws Exception{
UserUtil.update(newUser);

//Call Resource
final Response responseResource = resource.resetPassword(getHttpRequest(),getResetPasswordForm("n3wPa$$w0rD",token));
final Response responseResource = resource.resetPassword(getHttpRequest(),getResetPasswordForm(newPassword,token));
//Check that the response is 200, OK
Assert.assertEquals(Status.OK.getStatusCode(),responseResource.getStatus());
//Check password has changed
Expand All @@ -85,7 +86,7 @@ public void test_resetPassword_tokenNotBelongAnyUser_badRequest() {
final String token = ResetPasswordTokenUtil.createToken();

//Call Resource
final Response responseResource = resource.resetPassword(getHttpRequest(),getResetPasswordForm("n3wPa$$w0rD",token));
final Response responseResource = resource.resetPassword(getHttpRequest(),getResetPasswordForm(newPassword,token));
//Check that the response is 400
Assert.assertEquals(Status.BAD_REQUEST.getStatusCode(),responseResource.getStatus());
final ResponseEntityView responseEntityView = ResponseEntityView.class.cast(responseResource.getEntity());
Expand All @@ -111,7 +112,7 @@ public void testEXPIREDTOKEN() throws Exception{
UserUtil.update(newUser);

//Call Resource
final Response responseResource = resource.resetPassword(getHttpRequest(),getResetPasswordForm("n3wPa$$w0rD",token));
final Response responseResource = resource.resetPassword(getHttpRequest(),getResetPasswordForm(newPassword,token));
//Check that the response is 401
Assert.assertEquals(Status.FORBIDDEN.getStatusCode(),responseResource.getStatus());
final ResponseEntityView responseEntityView = ResponseEntityView.class.cast(responseResource.getEntity());
Expand Down

0 comments on commit 373d7fe

Please sign in to comment.