Custom mock mail server for JUnit tests?

I am looking for a mail server layout that can be configured as a Mockito mock object. We currently use GreenMail as a mock mail server, but I would like to do something similar in my unit tests:

  • If a message with an xyz object arrives, accept.
  • if mail with object zz1 arrives, send a temporary refusal
  • If a message is sent with the message fh2, send a rebound (unknown recipient).
  • .....

As I see it, GreenMail is not capable of this. Does anyone know a library that can do something like this?

+5
source share
3

, , greenmail SMTP- x-mail smtp- x-mail smtp . . , . .

0

"dumbster" (http://quintanasoft.com/dumbster/) , . javadoc, / , , .

0

All Articles