I’m looking for a mail server mock that can be configured like a Mockito mock object.
Currently we are using GreenMail as mail server mock, but I would like to do something like this in my unit tests:
- if mail with subject xyz arrives, accept.
- if mail with subject zz1 arrives, send temporarily failure
- if mail with subject fh2 arrives, send bounce (unknown recipient).
- …..
As I can see, GreenMail is not capable of this.
Does anyone knows a library which can do something like this?
So, finally i extended greenmail with the functionallity to close smtp server after x mails or skip acceptance of smtp connection after x mails and to slow down the smtp handling for a specific mail.
Thanks for the answers.
Its possible that i’m allowed to push my changes back to greenmail trunk. We’ll see.