I have a set of Java, email related unit tests that are currently using Wiser as a test SMTP server. It works great for basic email testing (send email, check to ensure it was received, etc.), but I have logic that I would like to exercise around retrying failed email sends based on error response returned from the SMTP server. Does anyone know of any test SMTP servers out there that support rigging them to respond in a prescribed way? Preferably, a pure Java server that could be spun up by the unit tests themselves would be best, but any stand alone server that fits the bill would work. Thanks.
Share
Kohsuke Kawaguchi wrote a JavaMail provider for unit tests, and I know that it supports some error condition simulation. You can take a look at it here: Mock JavaMail.
The error simulation is pretty simple. He says,