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

[FEATURE] Mock EmailServiceTest #3

Open
gstuer opened this issue Jul 29, 2020 · 1 comment
Open

[FEATURE] Mock EmailServiceTest #3

gstuer opened this issue Jul 29, 2020 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@gstuer
Copy link
Member

gstuer commented Jul 29, 2020

Circumstances
The EmailServiceTest class sends real emails with a JavaMailer instance. Therefore, testing the sent Strings is impossible.

Recommended Solution
Mock the JavaMailer and return the String instead of delivering it to the SMTP server.

Alternatives

  • Keeping the test as "real" as possible and using it only if testing of email functionality is required. So the test class have to stay ignored by jUnit.
  • Adding a filter to the noreply gmail account and use it for fetching all mails. They should be grouped within a folder to make bulk deletion possible. (-> Better solution than mocking?)
@gstuer gstuer added enhancement New feature or request question Further information is requested labels Jul 29, 2020
@holtvogt
Copy link
Member

Mocking the JavaMailer sounds like the simplest solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants