-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1847 from cultuurnet/III-6370-expose-email-in-own…
…ership III-6370 Expose email in ownership
- Loading branch information
Showing
7 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ Feature: Test approving ownership | |
And the JSON response at "itemId" should be "%{organizerId}" | ||
And the JSON response at "itemType" should be "organizer" | ||
And the JSON response at "ownerId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "ownerEmail" should be "[email protected]" | ||
And the JSON response at "requesterId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "state" should be "approved" | ||
|
||
|
@@ -29,6 +30,7 @@ Feature: Test approving ownership | |
And the JSON response at "itemId" should be "%{organizerId}" | ||
And the JSON response at "itemType" should be "organizer" | ||
And the JSON response at "ownerId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "ownerEmail" should be "[email protected]" | ||
And the JSON response at "requesterId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "state" should be "approved" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ Feature: Test deleting ownership | |
And the JSON response at "itemId" should be "%{organizerId}" | ||
And the JSON response at "itemType" should be "organizer" | ||
And the JSON response at "ownerId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "ownerEmail" should be "[email protected]" | ||
And the JSON response at "requesterId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "state" should be "deleted" | ||
|
||
|
@@ -31,6 +32,7 @@ Feature: Test deleting ownership | |
And the JSON response at "itemId" should be "%{organizerId}" | ||
And the JSON response at "itemType" should be "organizer" | ||
And the JSON response at "ownerId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "ownerEmail" should be "[email protected]" | ||
And the JSON response at "requesterId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "state" should be "deleted" | ||
|
||
|
@@ -46,6 +48,7 @@ Feature: Test deleting ownership | |
And the JSON response at "itemId" should be "%{organizerId}" | ||
And the JSON response at "itemType" should be "organizer" | ||
And the JSON response at "ownerId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "ownerEmail" should be "[email protected]" | ||
And the JSON response at "requesterId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "state" should be "deleted" | ||
|
||
|
@@ -59,6 +62,7 @@ Feature: Test deleting ownership | |
And the JSON response at "itemId" should be "%{organizerId}" | ||
And the JSON response at "itemType" should be "organizer" | ||
And the JSON response at "ownerId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "ownerEmail" should be "[email protected]" | ||
And the JSON response at "requesterId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "state" should be "deleted" | ||
|
||
|
@@ -73,6 +77,7 @@ Feature: Test deleting ownership | |
And the JSON response at "itemId" should be "%{organizerId}" | ||
And the JSON response at "itemType" should be "organizer" | ||
And the JSON response at "ownerId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "ownerEmail" should be "[email protected]" | ||
And the JSON response at "requesterId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "state" should be "deleted" | ||
|
||
|
@@ -87,6 +92,7 @@ Feature: Test deleting ownership | |
And the JSON response at "itemId" should be "%{organizerId}" | ||
And the JSON response at "itemType" should be "organizer" | ||
And the JSON response at "ownerId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "ownerEmail" should be "[email protected]" | ||
And the JSON response at "requesterId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "state" should be "deleted" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ Feature: Test rejecting ownership | |
And the JSON response at "itemId" should be "%{organizerId}" | ||
And the JSON response at "itemType" should be "organizer" | ||
And the JSON response at "ownerId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "ownerEmail" should be "[email protected]" | ||
And the JSON response at "requesterId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "state" should be "rejected" | ||
|
||
|
@@ -29,6 +30,7 @@ Feature: Test rejecting ownership | |
And the JSON response at "itemId" should be "%{organizerId}" | ||
And the JSON response at "itemType" should be "organizer" | ||
And the JSON response at "ownerId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "ownerEmail" should be "[email protected]" | ||
And the JSON response at "requesterId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "state" should be "rejected" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ Feature: Test requesting ownership | |
And the JSON response at "itemId" should be "%{organizerId}" | ||
And the JSON response at "itemType" should be "organizer" | ||
And the JSON response at "ownerId" should be "auth0|64089494e980aedd96740212" | ||
And the JSON response at "ownerEmail" should be "[email protected]" | ||
And the JSON response at "requesterId" should be "7a583ed3-cbc1-481d-93b1-d80fff0174dd" | ||
And the JSON response at "state" should be "requested" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ | |
use CultuurNet\UDB3\ReadModel\InMemoryDocumentRepository; | ||
use CultuurNet\UDB3\ReadModel\JsonDocument; | ||
use CultuurNet\UDB3\RecordedOn; | ||
use CultuurNet\UDB3\User\UserIdentityDetails; | ||
use CultuurNet\UDB3\User\UserIdentityResolver; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class OwnershipLDProjectorTest extends TestCase | ||
|
@@ -29,7 +31,19 @@ protected function setUp(): void | |
|
||
$this->ownershipRepository = new InMemoryDocumentRepository(); | ||
|
||
$this->ownershipLDProjector = new OwnershipLDProjector($this->ownershipRepository); | ||
$userIdentityResolver = $this->createMock(UserIdentityResolver::class); | ||
$userIdentityResolver->expects($this->any()) | ||
->method('getUserById') | ||
->willReturn(new UserIdentityDetails( | ||
'auth0|63e22626e39a8ca1264bd29b', | ||
'dev+e2e', | ||
'[email protected]' | ||
)); | ||
|
||
$this->ownershipLDProjector = new OwnershipLDProjector( | ||
$this->ownershipRepository, | ||
$userIdentityResolver | ||
); | ||
} | ||
|
||
/** | ||
|
@@ -200,6 +214,7 @@ private function createOwnershipJsonDocument( | |
$jsonLD->{'itemId'} = '9e68dafc-01d8-4c1c-9612-599c918b981d'; | ||
$jsonLD->{'itemType'} = 'organizer'; | ||
$jsonLD->{'ownerId'} = 'auth0|63e22626e39a8ca1264bd29b'; | ||
$jsonLD->{'ownerEmail'} = '[email protected]'; | ||
$jsonLD->{'requesterId'} = 'google-oauth2|102486314601596809843'; | ||
$jsonLD->{'state'} = $state->toString(); | ||
$jsonLD->{'created'} = $recordedOn->toString(); | ||
|