Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-updating Spryker modules on 2025-01-27 12:11 for release group #5704 / Jira ticket ACP-4499 #635

Merged
merged 3 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 35 additions & 34 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions src/Pyz/Zed/MessageBroker/MessageBrokerConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,19 @@ public function getDefaultWorkerChannels(): array
'tax-commands',
];
}

/**
* Specification:
* - Returns system worker channels used to retrieve service messages.
*
* @api
*
* @return list<string>
*/
public function getSystemWorkerChannels(): array
{
return [
'app-events',
];
}
}
11 changes: 11 additions & 0 deletions src/Pyz/Zed/MessageBroker/MessageBrokerDependencyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace Pyz\Zed\MessageBroker;

use Spryker\Zed\Asset\Communication\Plugin\MessageBroker\AssetMessageHandlerPlugin;
use Spryker\Zed\KernelApp\Communication\Plugin\MessageBroker\ActiveAppFilterMessageChannelPlugin;
use Spryker\Zed\MessageBroker\Communication\Plugin\MessageBroker\CorrelationIdMessageAttributeProviderPlugin;
use Spryker\Zed\MessageBroker\Communication\Plugin\MessageBroker\TenantActorMessageAttributeProviderPlugin;
use Spryker\Zed\MessageBroker\Communication\Plugin\MessageBroker\TimestampMessageAttributeProviderPlugin;
Expand Down Expand Up @@ -91,4 +92,14 @@ public function getMiddlewarePlugins(): array
new ValidationMiddlewarePlugin(),
];
}

/**
* @return array<\Spryker\Zed\MessageBrokerExtension\Dependency\Plugin\FilterMessageChannelPluginInterface>
*/
public function getFilterMessageChannelPlugins(): array
{
return [
new ActiveAppFilterMessageChannelPlugin(),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public function testCheckAttributesBeforeSendingMessage(): void
// Arrange
$messageSenderPlugin = $this->createMock(MessageSenderPluginInterface::class);

$this->tester->setupMessageBrokerPlugins();
$this->tester->setMessageToSenderChannelNameMap(MessageBrokerTestMessageTransfer::class, static::CHANNEL_NAME);
$this->tester->setChannelToTransportMap(static::CHANNEL_NAME, $messageSenderPlugin->getTransportName());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public function testAssetAddedMessageIsSuccessfullyHandled(): void

// Act
$this->tester->setupMessageBroker($assetAddedTransfer::class, $channelName);
$this->tester->setupMessageBrokerPlugins();
$messageBrokerFacade = $this->tester->getLocator()->messageBroker()->facade();
$messageBrokerFacade->sendMessage($assetAddedTransfer);
$messageBrokerFacade->startWorker($this->tester->buildMessageBrokerWorkerConfigTransfer([$channelName], 1));
Expand All @@ -73,6 +74,7 @@ public function testAssetUpdatedMessageIsSuccessfullyHandled(): void
$slotName = 'header-top';

$this->tester->setupMessageBroker(AssetAddedTransfer::class, $channelName);
$this->tester->setupMessageBrokerPlugins();
$messageBrokerFacade = $this->tester->getLocator()->messageBroker()->facade();
$messageBrokerWorkerConfigTransfer = $this->tester->buildMessageBrokerWorkerConfigTransfer([$channelName], 1);
$messageBrokerFacade->sendMessage(
Expand Down Expand Up @@ -110,6 +112,7 @@ public function testAssetDeletedMessageIsSuccessfullyHandled(): void
$assetUuid = Uuid::uuid4()->toString();

$this->tester->setupMessageBroker(AssetAddedTransfer::class, $channelName);
$this->tester->setupMessageBrokerPlugins();
$messageBrokerFacade = $this->tester->getLocator()->messageBroker()->facade();
$messageBrokerWorkerConfigTransfer = $this->tester->buildMessageBrokerWorkerConfigTransfer([$channelName], 1);
$messageBrokerFacade->sendMessage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Generated\Shared\Transfer\DeletePaymentMethodTransfer;
use PyzTest\Zed\MessageBroker\PageObject\PaymentMethodPage;
use PyzTest\Zed\MessageBroker\PaymentMethodPresentationTester;
use Spryker\Zed\MessageBroker\MessageBrokerDependencyProvider;

/**
* Auto-generated group annotations
Expand Down Expand Up @@ -56,6 +57,8 @@ public function testAddPaymentMethodMessageIsSuccessfullyHandled(PaymentMethodPr
// Act
$channelName = 'payment-method-commands';
$I->setupMessageBroker(AddPaymentMethodTransfer::class, $channelName);
$I->setDependency(MessageBrokerDependencyProvider::PLUGINS_EXTERNAL_VALIDATOR, []);
$I->setDependency(MessageBrokerDependencyProvider::PLUGINS_FILTER_MESSAGE_CHANNEL, []);
$messageBrokerFacade->sendMessage(
$I->haveAddPaymentMethodTransfer(
[
Expand Down Expand Up @@ -97,6 +100,8 @@ public function testPaymentMethodRemovedMessageIsSuccessfullyHandled(PaymentMeth

$channelName = 'payment-method-commands';
$I->setupMessageBroker(AddPaymentMethodTransfer::class, $channelName);
$I->setDependency(MessageBrokerDependencyProvider::PLUGINS_EXTERNAL_VALIDATOR, []);
$I->setDependency(MessageBrokerDependencyProvider::PLUGINS_FILTER_MESSAGE_CHANNEL, []);
$messageBrokerFacade->sendMessage(
$I->haveAddPaymentMethodTransfer(
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public function testInitializeProductExportMessageIsSuccessfullyHandled(): void

// Act
$this->tester->setupMessageBroker(InitializeProductExportTransfer::class, $channelName);
$this->tester->setupMessageBrokerPlugins();
$messageBrokerFacade = $this->tester->getLocator()->messageBroker()->facade();
$messageBrokerFacade->sendMessage(
$this->tester->buildInitializeProductExportTransfer(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function testAddReviewsMessageIsSuccessfullyHandled(): void

// Act
$this->tester->setupMessageBroker($addReviewsTransfer::class, $channelName);
$this->tester->setupMessageBrokerPlugins();
$messageBrokerFacade = $this->tester->getLocator()->messageBroker()->facade();
$messageBrokerFacade->sendMessage($addReviewsTransfer);
$messageBrokerFacade->startWorker($this->tester->buildMessageBrokerWorkerConfigTransfer([$channelName], 1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function testSearchEndpointAvailableMessageIsSuccessfullyHandled(): void
$this->tester->handleSearchMessage($searchEndpointAvailableTransfer);

// Assert
$this->tester->assertSearchHttpConfigExists();
$this->tester->assertSearchHttpConfigExistsForStore();
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* This file is part of the Spryker Commerce OS.
* For full license information, please view the LICENSE file that was distributed with this source code.
*/

declare(strict_types = 1);

namespace PyzTest\Zed\MessageBroker\Helper;

use Codeception\Module;
use Spryker\Zed\MessageBroker\MessageBrokerDependencyProvider;
use SprykerTest\Zed\Testify\Helper\Business\DependencyProviderHelperTrait;

class MessageBrokerHelper extends Module
{
use DependencyProviderHelperTrait;

/**
* @return void
*/
public function setupMessageBrokerPlugins(): void
{
$this->getDependencyProviderHelper()->setDependency(MessageBrokerDependencyProvider::PLUGINS_EXTERNAL_VALIDATOR, []);
$this->getDependencyProviderHelper()->setDependency(MessageBrokerDependencyProvider::PLUGINS_FILTER_MESSAGE_CHANNEL, []);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public function handlePaymentMessageTransfer(TransferInterface $paymentMessageTr
{
$channelName = 'payment-commands';
$this->setupMessageBroker($paymentMessageTransfer::class, $channelName);
$this->setupMessageBrokerPlugins();
$messageBrokerFacade = $this->getLocator()->messageBroker()->facade();
$messageBrokerFacade->sendMessage($paymentMessageTransfer);
$messageBrokerFacade->startWorker(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class SearchHttpCommunicationTester extends Actor
/**
* @return void
*/
public function assertSearchHttpConfigExists(): void
public function assertSearchHttpConfigExistsForStore(): void
{
$searchHttpConfigEntity = $this->getSearchHttpConfigEntity();

Expand Down Expand Up @@ -99,6 +99,7 @@ public function handleSearchMessage(TransferInterface $searchMessageTransfer): v
{
$channelName = 'search-commands';
$this->setupMessageBroker($searchMessageTransfer::class, $channelName);
$this->setupMessageBrokerPlugins();
$messageBrokerFacade = $this->getLocator()->messageBroker()->facade();
$messageBrokerFacade->sendMessage($searchMessageTransfer);
$messageBrokerFacade->startWorker(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public function handleTaxAppMessage(TransferInterface $configureTaxAppMessage):
{
$channelName = 'tax-commands';
$this->setupMessageBroker($configureTaxAppMessage::class, $channelName);
$this->setupMessageBrokerPlugins();
$messageBrokerFacade = $this->getLocator()->messageBroker()->facade();
$messageBrokerFacade->sendMessage($configureTaxAppMessage);
$messageBrokerFacade->startWorker(
Expand Down
Loading
Loading