Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rest assured api tests #493

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

rest assured api tests #493

wants to merge 1 commit into from

Conversation

kingap
Copy link

@kingap kingap commented Dec 9, 2020

No description provided.

@dbroda dbroda requested review from adamw and dbroda December 9, 2020 11:04
passwordResetEndpoint.forgotPassword(login);
Assertions.assertEquals(200, passwordResetEndpoint.getLastStatusCode());

try {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could (and probably will) happen that mail service will be laggy and this 2s timeout will not be enough. Besides, in a normal situation - it could give a valid response after several milliseconds. To avoid unnecessary waiting, you could use a library like the "awaitility" (https://github.com/awaitility/awaitility).
It polls several times a resource to check if the certain job was completed. In our case, it will be a response with mail sent from bootzooka


String emailWithCode = mailHogEndpoint.getLastResponse().jsonPath().get("items[0]").toString();
Matcher m = Pattern.compile("code=(.+)").matcher(emailWithCode);
m.find();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be hidden in the internals of mailhog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants