Skip to content

Commit bb2f427

Browse files
committed
CABPI-324: Change Org check to use new endpoint
1 parent 2a720c3 commit bb2f427

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

app/code/Magento/AdminAdobeIms/Service/ImsOrganizationService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function checkOrganizationAllocation(string $token): bool
3838
$configuredOrganization = $this->adminImsConfig->getOrganizationId();
3939

4040
//@TODO CABPI-324: Change Org check to use new endpoint
41-
if (!$configuredOrganization || !$token) {
41+
if ($configuredOrganization === '' || !$token) {
4242
throw new AdobeImsOrganizationAuthorizationException(
4343
__('User is not assigned to defined organization.')
4444
);

app/code/Magento/AdminAdobeIms/Test/Unit/Service/ImsOrganizationServiceTest.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,19 @@ public function testCheckOrganizationAllocationReturnsTrueWhenProfileAssignedToO
5151

5252
$this->assertEquals(
5353
true,
54-
$this->imsOrganizationService->checkOrganizationAllocation([
55-
'roles' => [
56-
['organization' => '12121212ABCD1211AA11ABCD', 'named_role' => 'test']
57-
]
58-
])
54+
$this->imsOrganizationService->checkOrganizationAllocation('my_token')
5955
);
6056
}
6157

6258
public function testCheckOrganizationAllocationThrowsExceptionWhenProfileNotAssignedToOrg()
6359
{
64-
$this->markTestSkipped('CABPI-324: Change Org check to use new endpoint');
6560
$this->adminImsConfigMock
6661
->method('getOrganizationId')
67-
->willReturn(self::INVALID_ORGANIZATION_ID);
62+
->willReturn('');
6863

6964
$this->expectException(AdobeImsOrganizationAuthorizationException::class);
70-
$this->expectExceptionMessage('Profile is not assigned to defined organization.');
65+
$this->expectExceptionMessage('User is not assigned to defined organization.');
7166

72-
$this->imsOrganizationService->checkOrganizationAllocation([
73-
'roles' => [
74-
['organization' => '12121212ABCD1211AA11ABCD', 'named_role' => 'test']
75-
]
76-
]);
67+
$this->imsOrganizationService->checkOrganizationAllocation('my_token');
7768
}
7869
}

0 commit comments

Comments
 (0)