Tagged: API Testing

Linked List: Fake or Mock SMTP Servers for Email Testing

To test SMTP integration, you can either send emails using the production SMTP or you can run a test SMTP server just for testing. But its not easy for every developer in your team to do that or make it part of your CI/CD. This is where Fake or Mock SMTP servers play a role. They can run on a developers machine and expose an SMTP endpoint to connect and send test emails. They usually have web access to view the test emails to check formatting etc, manually. Some of them also expose a web API to retrieve the content for CI/CD integration. Here are some of my favorite mock SMTP servers.

Karate Mocks on Google CloudRun

I have written mock features in Karate for integration testing. Recently I wanted to run them centrally somewhere so all my testing infra can use the same set of Mocks. I wanted an easy way to launch it and maintenance-free. So I tried it with CloudRun, which can run any stateless web service. One needs to provide a container to it. That’s all.