feat: CI/CD pipeline setup complete - Ansible playbooks updated, secrets configured, workflow ready
This commit is contained in:
@@ -12,13 +12,18 @@ use App\Domain\PreSave\ValueObjects\CampaignStatus;
|
||||
use App\Domain\PreSave\ValueObjects\RegistrationStatus;
|
||||
use App\Domain\PreSave\ValueObjects\StreamingPlatform;
|
||||
use App\Domain\PreSave\ValueObjects\TrackUrl;
|
||||
use App\Framework\Core\ValueObjects\Duration;
|
||||
use App\Framework\Core\ValueObjects\Timestamp;
|
||||
use App\Framework\Exception\FrameworkException;
|
||||
use App\Framework\Logging\Logger;
|
||||
use App\Framework\OAuth\OAuthServiceInterface;
|
||||
use App\Framework\OAuth\Providers\SupportsPreSaves;
|
||||
use App\Framework\OAuth\Storage\StoredOAuthToken;
|
||||
use App\Framework\OAuth\ValueObjects\AccessToken;
|
||||
use App\Framework\OAuth\ValueObjects\OAuthToken;
|
||||
use App\Framework\OAuth\ValueObjects\RefreshToken;
|
||||
use App\Framework\OAuth\ValueObjects\TokenScope;
|
||||
use App\Framework\OAuth\ValueObjects\TokenType;
|
||||
|
||||
// In-Memory Campaign Repository for Integration Testing
|
||||
class IntegrationCampaignRepository implements PreSaveCampaignRepositoryInterface
|
||||
@@ -61,7 +66,7 @@ class IntegrationCampaignRepository implements PreSaveCampaignRepositoryInterfac
|
||||
$now = Timestamp::now();
|
||||
return array_values(array_filter(
|
||||
$this->campaigns,
|
||||
fn($c) => $c->status === CampaignStatus::SCHEDULED
|
||||
fn($c) => ($c->status === CampaignStatus::SCHEDULED || $c->status === CampaignStatus::ACTIVE)
|
||||
&& $c->releaseDate->isBefore($now)
|
||||
));
|
||||
}
|
||||
@@ -193,14 +198,17 @@ class IntegrationOAuthService implements OAuthServiceInterface
|
||||
|
||||
// Create a token for this provider
|
||||
$this->tokens[$userId . '_' . $provider] = new StoredOAuthToken(
|
||||
id: null, // Auto-increment ID in real storage
|
||||
userId: $userId,
|
||||
provider: $provider,
|
||||
token: new OAuthToken(
|
||||
accessToken: 'test_access_token_' . $userId,
|
||||
tokenType: 'Bearer',
|
||||
expiresIn: 3600,
|
||||
refreshToken: 'test_refresh_token_' . $userId,
|
||||
scope: ['user-library-modify']
|
||||
accessToken: AccessToken::create(
|
||||
'test_access_token_' . $userId,
|
||||
Timestamp::now()->add(Duration::fromHours(1)) // Expires in 1 hour
|
||||
),
|
||||
refreshToken: new RefreshToken('test_refresh_token_' . $userId),
|
||||
tokenType: TokenType::BEARER,
|
||||
scope: TokenScope::fromString('user-library-modify')
|
||||
),
|
||||
createdAt: Timestamp::now(),
|
||||
updatedAt: Timestamp::now()
|
||||
|
||||
@@ -316,9 +316,14 @@ describe('SmartLink Integration', function () {
|
||||
// Delete link
|
||||
$this->service->deleteLink($link->id);
|
||||
|
||||
// Verify link is deleted
|
||||
expect(fn() => $this->service->findById($link->id))
|
||||
->toThrow(\App\Domain\SmartLink\Exceptions\SmartLinkNotFoundException::class);
|
||||
// Verify link is deleted - use try-catch instead of toThrow()
|
||||
$threwCorrectException = false;
|
||||
try {
|
||||
$this->service->findById($link->id);
|
||||
} catch (\App\Domain\SmartLink\Exceptions\SmartLinkNotFoundException $e) {
|
||||
$threwCorrectException = true;
|
||||
}
|
||||
expect($threwCorrectException)->toBeTrue();
|
||||
|
||||
// Verify destinations are deleted (getDestinations returns empty array)
|
||||
$afterDelete = $this->service->getDestinations($link->id);
|
||||
|
||||
Reference in New Issue
Block a user