开发者

mailserver mock for integration tests inside cargo

I've got a web application i'm currently testing on different levels (junit tests, integration tests within cargo container running a tomcat, htmlunit etc.) and i'm facing a problem now.

With some input information my web application is generating a zip-file i can download after the process creating it has bee开发者_Go百科n finished. At least there was no problem testing different use cases with htmlunit and a cargo container starting all applications and backends needed inside a single tomcat.

The new version of my web application is sending (javax.mail) the generated file to a configured email-address (i sent that mail manually before), but i can't figure out how to integration-test what it's sending and if it succeeded.

Is there any mock-mailserver or sth like that i can easily run inside my cargo testing container, configure it in my application and assert all the mails it has received?

i don't want to use a static mailserver running outside my testing area, because there are different environments these tests have to run inside (development, hudson, integration-environment etc.) and i would be dependent on its state and availability.

if not, are there maybe any other solutions? thank you a lot.


I'd go for Dumbster. It's a fake SMTP server with an API you can query to find out what messages were sent.

You can start it at the beginning of your test and check the sent messages at the end. (No need to deploy it in cargo)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜