My Java application encountered an issue in production where the SMTP server is rejecting mails sent to more than x destinations at once. I would like to test the behavior of the application in that situation.
I found Dumbster Fake SMTP Server that is very nice but does not seem to offer a way to reject messages in some tests.
Do you have any suggestions on how I could test this specific scenario ?
I do not know Dumbster, but SubEthaSMTP does have this capability. Maybe the simplest solution is to extend the Wiser class (which implements a simple SMTP server specifically for testing) by overriding its accept method, returning false after the x. recipient.