fix(queue): add explicit tries and timeout to SendClientSecurityAlertMail (F-2026-0007)

This commit is contained in:
Jérémy Munsch 2026-08-26 10:10:52 +02:00
parent 9a0328d884
commit a4cc75d697
Signed by: forge-joniko
GPG key ID: D7EFE2F5CB6CC0E4
2 changed files with 14 additions and 0 deletions

View file

@ -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,

View file

@ -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());