config()->set('services.keyso.base_url', 'https://api.keys.so')); it('зелёный при 200', function () { Http::fake(['api.keys.so/*' => Http::response('ok', 200)]); expect((new KeysoLivenessProbe)->check()->light)->toBe('green'); }); it('зелёный при 404 (хост достучались — keys.so жив)', function () { Http::fake(['api.keys.so/*' => Http::response('Not Found', 404)]); expect((new KeysoLivenessProbe)->check()->light)->toBe('green'); }); it('красный при 5xx и при обрыве', function () { Http::fake(['api.keys.so/*' => Http::response('err', 503)]); expect((new KeysoLivenessProbe)->check()->light)->toBe('red'); Http::fake(fn () => throw new RuntimeException('down')); expect((new KeysoLivenessProbe)->check()->light)->toBe('red'); }); it('серый, когда base_url пуст', function () { config()->set('services.keyso.base_url', ''); expect((new KeysoLivenessProbe)->check()->light)->toBe('grey'); }); it('serviceKey = keyso', function () { expect((new KeysoLivenessProbe)->serviceKey())->toBe('keyso'); });