Added GDPR report test for events.SpaceCreated (#6397)
This commit is contained in:
@@ -122,7 +122,7 @@ Feature: user GDPR (General Data Protection Regulation) report
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
And the downloaded JSON content should contain event type "events.SpaceCreated" in item 'events' and should match
|
And the downloaded JSON content should contain event type "events.SpaceCreated" for "personal" space and should match
|
||||||
"""
|
"""
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
@@ -955,3 +955,62 @@ Feature: user GDPR (General Data Protection Regulation) report
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: generate a GDPR report and check events when a space is created
|
||||||
|
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
|
||||||
|
And user "Alice" has created a space "GDPR Space" with the default quota using the GraphApi
|
||||||
|
When user "Alice" exports her GDPR report to "/.personal_data_export.json" using the Graph API
|
||||||
|
And user "Alice" downloads the content of GDPR report ".personal_data_export.json"
|
||||||
|
Then the HTTP status code of responses on each endpoint should be "201, 200" respectively
|
||||||
|
And the downloaded JSON content should contain event type "events.SpaceCreated" for "project" space and should match
|
||||||
|
"""
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"event"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"event" : {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"Executant",
|
||||||
|
"Name",
|
||||||
|
"Type"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"Executant": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"idp",
|
||||||
|
"opaque_id",
|
||||||
|
"type"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"idp": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^%base_url%$"
|
||||||
|
},
|
||||||
|
"opaque_id": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^%user_id_pattern%$"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "number",
|
||||||
|
"enum": [1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Name": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["GDPR Space"]
|
||||||
|
},
|
||||||
|
"Type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["project"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|||||||
@@ -2340,19 +2340,28 @@ class GraphContext implements Context {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @Then the downloaded JSON content should contain event type :eventType in item 'events' and should match
|
* @Then the downloaded JSON content should contain event type :eventType in item 'events' and should match
|
||||||
|
* @Then the downloaded JSON content should contain event type :eventType for :spaceType space and should match
|
||||||
*
|
*
|
||||||
* @param string $eventType
|
* @param string $eventType
|
||||||
* @param PyStringNode $schemaString
|
* @param string|null $spaceType
|
||||||
|
* @param PyStringNode|null $schemaString
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
* @throws GuzzleException
|
* @throws GuzzleException
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function downloadedJsonContentShouldContainEventTypeInItemAndShouldMatch(string $eventType, PyStringNode $schemaString): void {
|
public function downloadedJsonContentShouldContainEventTypeInItemAndShouldMatch(string $eventType, ?string $spaceType=null, PyStringNode $schemaString=null): void {
|
||||||
$actualResponseToAssert = null;
|
$actualResponseToAssert = null;
|
||||||
$events = $this->featureContext->getJsonDecodedResponseBodyContent()->events;
|
$events = $this->featureContext->getJsonDecodedResponseBodyContent()->events;
|
||||||
foreach ($events as $event) {
|
foreach ($events as $event) {
|
||||||
if ($event->type === $eventType) {
|
if ($event->type === $eventType) {
|
||||||
|
if ($spaceType !== null) {
|
||||||
|
if ($event->event->Type === $spaceType) {
|
||||||
|
$actualResponseToAssert = $event;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$actualResponseToAssert = $event;
|
$actualResponseToAssert = $event;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user