Skip to content

Commit 74ff6b3

Browse files
CABI-365::AdobeAdminIms to AdobeIms code migration-updated webapi tests and integration tests
1 parent fdfe27c commit 74ff6b3

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

app/code/Magento/AdobeIms/Test/Integration/Model/ConfigTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818
class ConfigTest extends TestCase
1919
{
20-
private const SCOPES = ['creative_sdk', 'openid', 'creative_sdk', 'email', 'profile'];
20+
private const SCOPES = ['creative_sdk', 'openid', 'email', 'profile'];
2121
private const LOCALE = 'en_US';
2222
private const REDIRECT_URL_PATTERN = '/redirect_uri=[a-zA-Z0-9\/:._]*\/adobe_ims\/oauth\/callback/';
2323

app/code/Magento/AdobeIms/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"magento/module-authorization": "*",
99
"magento/module-backend": "*",
1010
"magento/module-config": "*",
11-
"magento/module-user": "*"
11+
"magento/module-user": "*",
12+
"magento/module-integration": "*"
1213
},
1314
"type": "magento2-module",
1415
"license": [

dev/tests/api-functional/testsuite/Magento/AdminAdobeIms/Authorization/AdobeImsTokenUserContextTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
use Exception;
1212
use Magento\AdminAdobeIms\Api\ImsWebapiRepositoryInterface;
13-
use Magento\AdminAdobeIms\Service\ImsConfig;
1413
use Magento\Framework\App\CacheInterface;
1514
use Magento\Framework\App\Config\ScopeConfigInterface;
1615
use Magento\Framework\App\Config\Storage\WriterInterface;
@@ -41,6 +40,7 @@ class AdobeImsTokenUserContextTest extends WebapiAbstract
4140
private const SERVICE_VERSION = 'V1';
4241
private const KEYS_LOCATION = __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR;
4342
private const TEST_ADOBE_USER_ID = '121B46F2620BF4240A49TEST@AdobeID';
43+
private const XML_PATH_ENABLED = 'adobe_ims/integration/admin_enabled';
4444

4545
/**
4646
* @var JwtManagerInterface
@@ -106,7 +106,7 @@ protected function setUp(): void
106106
*/
107107
public function testUseAdobeAccessTokenModuleDisabled()
108108
{
109-
$this->configWriter->save(ImsConfig::XML_PATH_ENABLED, 0);
109+
$this->configWriter->save(self::XML_PATH_ENABLED, 0);
110110
$this->scopeConfig->clean();
111111

112112
$token = $this->createAccessToken();
@@ -136,7 +136,7 @@ public function testUseAdobeAccessTokenSuccess()
136136
{
137137
$adminUserNameFromFixture = 'webapi_user';
138138
$token = $this->createAccessToken();
139-
$this->configWriter->save(ImsConfig::XML_PATH_ENABLED, 1);
139+
$this->configWriter->save(self::XML_PATH_ENABLED, 1);
140140
$this->scopeConfig->clean();
141141
$this->runWebApiCall($token);
142142
$this->assertAdminUserIdIsSaved($adminUserNameFromFixture, $token);

dev/tests/api-functional/testsuite/Magento/AdminAdobeIms/Plugin/AdminTokenPluginTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
class AdminTokenPluginTest extends WebapiAbstract
2121
{
2222
private const RESOURCE_PATH_ADMIN_TOKEN = "/V1/integration/admin/token";
23+
private const XML_PATH_ENABLED = 'adobe_ims/integration/admin_enabled';
2324

2425
/**
2526
* @var WriterInterface
@@ -51,7 +52,7 @@ public function testAdminTokenGenerationDisabled()
5152
{
5253
$adminUserNameFromFixture = 'webapi_user';
5354

54-
$this->configWriter->save(ImsConfig::XML_PATH_ENABLED, 1);
55+
$this->configWriter->save(self::XML_PATH_ENABLED, 1);
5556
$this->scopeConfig->clean();
5657

5758
$noExceptionOccurred = false;
@@ -79,7 +80,7 @@ public function testAdminTokenGenerationDisabled()
7980
$this->fail("Exception was expected to be thrown when Admin Adobe Ims module is enabled.");
8081
}
8182

82-
$this->configWriter->save(ImsConfig::XML_PATH_ENABLED, 0);
83+
$this->configWriter->save(self::XML_PATH_ENABLED, 0);
8384
$this->scopeConfig->clean();
8485
}
8586
}

0 commit comments

Comments
 (0)