Last week I received a mail from a user:
Subject: "RE: Testing WTF"
Body: "please stop sending these test emails"
At first, we tried to replace all the email addresses on the database and config files, but the feature that sends the emails uses a lot of business logic. So we wanted to test the feature with a more realistic and end-to-end approach.
After looking for a while I found this lovely piece of software. MockMock is a very simple but powerful SMTP mock server built in java.
How it works:
Simply download the MockMock.jar and run java -jar MockMock.jar
this starts the SMTP server on the port 25 and an HTTP server on port 8282.
Now you can configure your SMTP server as localhost
on port 25
, when the application sends an email just browse on http://localhost:8282/
and you'll see something like this:
And we can see de detailed info of each mail:
You can also change the ports with -p
argument for SMPT and -h
for HTML like java -jar MockMock.jar -p 25250 -h 8080
I love this type of test because we can extend our test cases and look for the result in a fancy and safe way.
Top comments (0)