سؤال

I have some cron jobs that sends out emails in production, is there such an option to prevent sending out email in testing?

Right now I'm hoping to find such an java_opt option or re implement lots of email functions...

هل كانت مفيدة؟

المحلول

No. Best would be to mock the email service. So that you can test that an email has been handed over to the service without actually sending it.

Or implement a dummyservice (assuming you have programmed your email service against an interface) and use that for testing.

نصائح أخرى

DevNullSMTPServer will simulate a local SMTP server and log the outgoing emails rather than send them.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top