diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentGetTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentGetTest.php index aaa7a5a6d4436..2b7e76aee0751 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentGetTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentGetTest.php @@ -5,6 +5,8 @@ */ namespace Magento\Sales\Service\V1; +use Magento\Framework\Api\ExtensibleDataInterface; +use Magento\Framework\Api\SimpleDataObjectConverter; use Magento\TestFramework\TestCase\WebapiAbstract; /** @@ -57,7 +59,18 @@ public function testShipmentGet() unset($data['tracks']); foreach ($data as $key => $value) { if (!empty($value)) { - $this->assertEquals($shipment->getData($key), $value, $key); + if ($key === ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY) { + foreach ($value as $extensionAttributeKey => $extensionAttributeValue) { + $methodName = 'get' . + SimpleDataObjectConverter::snakeCaseToUpperCamelCase($extensionAttributeKey); + $this->assertEquals( + $shipment->getExtensionAttributes()->$methodName(), + $extensionAttributeValue + ); + } + } else { + $this->assertEquals($shipment->getData($key), $value, $key); + } } } $shipmentItem = $this->objectManager->get(\Magento\Sales\Model\Order\Shipment\Item::class);