As is:
Endpoints sending emails are currently tested by calling the endpoint but catching an expected server error response.
Should be:
Integration tests for endpoints sending emails should use a (dockerized) SMTP server to simulate email transfer so there's no need to catch expected server error responses.