Skip to content

Commit

Permalink
APPS-7209: Fixed message handlers to work with Dynamic Multi Store (#…
Browse files Browse the repository at this point in the history
…10397)

APPS-7209 Fixed message handlers to work with Dynamic Multi Store
  • Loading branch information
oleksander-kiiashko authored Aug 21, 2023
1 parent d026eff commit 59b5c70
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 43 deletions.
13 changes: 13 additions & 0 deletions src/Spryker/Shared/Oms/Transfer/oms.transfer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<property name="locale" type="Locale"/>
<property name="templates" type="MailTemplate[]" singular="template"/>
<property name="recipients" type="MailRecipient[]" singular="recipient"/>
<property name="storeName" type="string"/>
</transfer>

<transfer name="Order">
Expand All @@ -38,6 +39,10 @@
<property name="lastName" type="string"/>
<property name="orderReference" type="string"/>
<property name="isCancellable" type="bool"/>
<property name="createdAt" type="string"/>
<property name="customer" type="Customer"/>
<property name="store" type="string"/>
<property name="merchants" type="OrderMerchant[]" singular="merchant" strict="true"/>
</transfer>

<transfer name="OmsAvailabilityReservationRequest">
Expand Down Expand Up @@ -108,9 +113,11 @@
<property name="process" type="string"/>
<property name="stateHistory" type="ItemState[]" singular="stateHistory"/>
<property name="fkSalesOrder" type="int"/>
<property name="metadata" type="ItemMetadata"/>
</transfer>

<transfer name="Locale">
<property name="localeName" type="string"/>
</transfer>

<transfer name="Message">
Expand All @@ -128,6 +135,7 @@
<property name="idStore" type="int"/>
<property name="name" type="string"/>
<property name="storesWithSharedPersistence" type="array" singular="storeWithSharedPersistence"/>
<property name="storeReference" type="string"/>
</transfer>

<transfer name="CheckoutResponse">
Expand Down Expand Up @@ -255,6 +263,7 @@

<transfer name="AclEntityParentMetadata">
<property name="entityName" type="string"/>
<property name="connection" type="AclEntityParentConnectionMetadata"/>
</transfer>

<transfer name="AclEntityParentConnectionMetadata">
Expand All @@ -268,4 +277,8 @@
<property name="permissionMask" type="int"/>
</transfer>

<transfer name="ItemMetadata">
<property name="image" type="string"/>
</transfer>

</transfers>
41 changes: 0 additions & 41 deletions tests/SprykerTest/Zed/Oms/Business/OmsFacadeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,47 +481,6 @@ function (array $envelopes) use ($items): void {
);
}

/**
* @return void
*/
public function testOrderStatusChangedMessageWhenStoreReferenceAndPluginsAreProvidedThenMessageIsSent(): void
{
// Arrange
$this->tester->setupMessageBroker();

$this->tester->setStoreReferenceData([
'DE' => 'dev-DE',
'AT' => 'dev-AT',
]);

$orderTransfer = $this->tester->getOrderTransferAndSetupSalesFacadeMock();

// Act
$this->sendOrderStatusChangedMessage($orderTransfer);

// Assert
$this->tester->assertMessageWasSent(OrderStatusChangedTransfer::class);
}

/**
* @return void
*/
public function testOrderStatusChangedMessageWhenPluginsAreProvidedAndStoreReferenceIsMissingThenMessageIsNotSent(): void
{
// Arrange
$this->tester->setupMessageBroker();

$this->tester->setStoreReferenceData([]);

$orderTransfer = $this->tester->getOrderTransferAndSetupSalesFacadeMock();

// Act
$this->sendOrderStatusChangedMessage($orderTransfer);

// Assert
$this->tester->assertMessageWasNotSent(OrderStatusChangedTransfer::class);
}

/**
* @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
*
Expand Down
2 changes: 1 addition & 1 deletion tests/SprykerTest/Zed/Oms/_support/OmsBusinessTester.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = null)
* @method \Spryker\Zed\Oms\Business\OmsFacadeInterface getFacade()
*
* @SuppressWarnings(PHPMD)
* @SuppressWarnings(\SprykerTest\Zed\Oms\PHPMD)
*/
class OmsBusinessTester extends Actor
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @method void comment($description)
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = null)
*
* @SuppressWarnings(PHPMD)
* @SuppressWarnings(\SprykerTest\Zed\Oms\PHPMD)
*/
class OmsCommunicationTester extends Actor
{
Expand Down

0 comments on commit 59b5c70

Please sign in to comment.