diff --git a/src/Infra/Listeners/SendClientSecurityAlertMail.php b/src/Infra/Listeners/SendClientSecurityAlertMail.php index 9210595..d1771b0 100644 --- a/src/Infra/Listeners/SendClientSecurityAlertMail.php +++ b/src/Infra/Listeners/SendClientSecurityAlertMail.php @@ -21,6 +21,10 @@ final class SendClientSecurityAlertMail implements ShouldQueue use InteractsWithQueue; use Queueable; + public int $tries = 3; + + public int $timeout = 30; + public function __construct( private readonly Mailer $mailer, private readonly SecurityAlertMailConfig $config, diff --git a/tests/Unit/Infra/Listeners/SendClientSecurityAlertMailTest.php b/tests/Unit/Infra/Listeners/SendClientSecurityAlertMailTest.php index fb6e45e..b47c0db 100644 --- a/tests/Unit/Infra/Listeners/SendClientSecurityAlertMailTest.php +++ b/tests/Unit/Infra/Listeners/SendClientSecurityAlertMailTest.php @@ -25,6 +25,16 @@ describe('SendClientSecurityAlertMail Listener Unit Tests', function (): void { Mail::fake(); }); + it('has explicit tries and timeout configuration', function (): void { + // GIVEN + $config = new SecurityAlertMailConfig(new Email('security@example.com')); + $listener = new SendClientSecurityAlertMail(Mail::mailer(), $config); + + // THEN + expect($listener->tries)->toBe(3) + ->and($listener->timeout)->toBe(30); + }); + it('sends email alert when ClientSecretGenerated is handled', function (): void { // GIVEN $clientId = new ClientId(Uuid::uuid7());