From 70589760352693bf74bbe252d783c5acff4e639f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 13 Jan 2025 17:07:27 +0100 Subject: [PATCH] #1803: upgrade existing tests and add tests for deploy --publish --- ...isting_journey_Multistep.journey-meta.json | 418 ++++++++++++++++ .../testExisting_temail.journey-meta.json | 212 ++++++++ ...ting_temail_notPublished.journey-meta.json | 217 +++++++++ .../9999999/event/get-published-expected.json | 30 ++ .../get-response.json | 39 ++ .../put-response.json | 461 ++++++++++++++++++ .../key_testExisting_temail/put-response.json | 219 +++++++++ .../put-response.json | 226 +++++++++ .../journey/get-published-expected.json | 217 +++++++++ test/type.journey.test.js | 205 +++++++- 10 files changed, 2239 insertions(+), 5 deletions(-) create mode 100644 test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Multistep.journey-meta.json create mode 100644 test/mockRoot/deploy/testInstance/testBU/journey/testExisting_temail.journey-meta.json create mode 100644 test/mockRoot/deploy/testInstance/testBU/journey/testExisting_temail_notPublished.journey-meta.json create mode 100644 test/resources/9999999/event/get-published-expected.json create mode 100644 test/resources/9999999/interaction/v1/eventDefinitions/key_DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e/get-response.json create mode 100644 test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/put-response.json create mode 100644 test/resources/9999999/interaction/v1/interactions/key_testExisting_temail/put-response.json create mode 100644 test/resources/9999999/interaction/v1/interactions/key_testExisting_temail_notPublished/put-response.json create mode 100644 test/resources/9999999/journey/get-published-expected.json diff --git a/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Multistep.journey-meta.json b/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Multistep.journey-meta.json new file mode 100644 index 000000000..e12c3fa55 --- /dev/null +++ b/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Multistep.journey-meta.json @@ -0,0 +1,418 @@ +{ + "key": "testExisting_journey_Multistep", + "name": "testExisting_journey_Multistep", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2024-05-04T05:54:48.027", + "modifiedDate": "2024-05-04T17:25:57.9", + "activities": [ + { + "id": "7ba1e59a-6be4-46c7-b76f-4c06feb1268a", + "key": "EMAILV2-1", + "name": "my custom activity name", + "description": "", + "type": "EMAILV2", + "outcomes": [ + { + "key": "ff60a294-3804-4165-85cd-c7c19c8e3a6d", + "next": "WAITBYDURATION-1", + "arguments": {}, + "metaData": { "invalid": false } + } + ], + "arguments": {}, + "configurationArguments": { + "applicationExtensionKey": "jb-email-activity", + "isModified": true, + "googleAnalyticsCampaignName": "", + "r__triggeredSend_key": "testExisting_triggeredSend", + "triggeredSend": { + "autoAddSubscribers": false, + "autoUpdateSubscribers": false, + "bccEmail": [], + "ccEmail": [], + "created": { "name": "", "date": "" }, + "description": "my custom description", + "domainExclusions": [], + "dynamicEmailSubject": "You are successfully unsubscribed", + "emailSubject": "You are successfully unsubscribed", + "exclusionFilter": "", + "isSalesforceTracking": false, + "isMultipart": false, + "isSendLogging": true, + "isStoppedOnJobError": false, + "modified": { "name": "", "date": "" }, + "preHeader": "testExisting_ email preheader", + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "isTrackingClicks": true, + "suppressTracking": false, + "triggeredSendStatus": "New", + "r__list_PathName": { "publicationList": "my subscribers/All Subscribers" }, + "r__deliveryProfile_key": "Default", + "r__senderProfile_key": "testExisting_senderProfile", + "r__sendClassification_key": "testExisting_sendClassification", + "c__priority": "Medium", + "r__asset_name_readOnly": "testExisting_asset_message", + "r__asset_key": "testExisting_asset_message", + "r__triggeredSend_key": "testExisting_triggeredSend" + } + }, + "metaData": { + "category": "message", + "version": "1.0", + "icon": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "iconSmall": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "statsContactIcon": null, + "original_icon": "/img/email-icon.svg", + "original_iconSmall": "/img/email-icon.svg", + "sections": {}, + "isConfigured": true + }, + "schema": { + "arguments": { + "requestID": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "messageKey": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "activityId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "definitionId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "emailSubjectDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "contactId": { + "dataType": "Number", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "contactKey": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "emailAddress": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "fieldType": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "eventData": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "obfuscationProperties": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "definitionInstanceId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + }, + { + "id": "342dd0aa-a6be-401e-8614-3538800bfd7c", + "key": "MULTICRITERIADECISIONV2-1", + "name": "", + "description": "", + "type": "MULTICRITERIADECISION", + "outcomes": [ + { + "key": "default_path_1", + "next": "EMAILV2-1", + "arguments": {}, + "metaData": { + "label": "send message", + "skipI18n": true, + "isLabelFromConversion": false, + "criteriaDescription": "Email is not null" + } + }, + { + "key": "remainder_path", + "next": "WAITBYDURATION-2", + "arguments": {}, + "metaData": { "label": null } + } + ], + "arguments": {}, + "configurationArguments": { + "criteria": { + "default_path_1": "" + }, + "schemaVersionId": "252" + }, + "metaData": { "isConfigured": true }, + "schema": { + "arguments": { + "actualChoice": { + "dataType": "Number", + "isNullable": false, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "filterResult": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": true, + "access": "Hidden" + } + } + } + }, + { + "id": "e2a486cf-c85f-4543-88a2-d579cac1e0de", + "key": "WAITBYDURATION-1", + "name": "1 day", + "description": "", + "type": "WAIT", + "outcomes": [ + { + "key": "97af222a-450a-429e-8925-649b72f01ccf", + "arguments": {}, + "metaData": { "invalid": false } + } + ], + "arguments": {}, + "configurationArguments": { "waitDuration": 1, "waitUnit": "DAYS" }, + "metaData": { "isConfigured": true, "uiType": "WAITBYDURATION" }, + "schema": { + "arguments": { + "endDate": { + "dataType": "Date", + "isNullable": false, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "waitEndDateAttributeDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitDefinitionId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitForEventId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "executionMode": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "startActivityKey": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitQueueId": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + }, + { + "id": "70572b1a-e274-4f09-a3fa-6fc0732ec52b", + "key": "WAITBYDURATION-2", + "name": "", + "description": "", + "type": "WAIT", + "outcomes": [ + { + "key": "a0908f9f-bc3c-47f7-9489-7fef5af25ce3", + "arguments": {}, + "metaData": { "invalid": false } + } + ], + "arguments": {}, + "configurationArguments": { "waitDuration": 1, "waitUnit": "DAYS" }, + "metaData": { "isConfigured": true, "uiType": "WAITBYDURATION" }, + "schema": { + "arguments": { + "endDate": { + "dataType": "Date", + "isNullable": false, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "waitEndDateAttributeDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitDefinitionId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitForEventId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "executionMode": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "startActivityKey": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitQueueId": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + } + ], + "triggers": [ + { + "key": "TRIGGER", + "name": "TRIGGER", + "description": "", + "type": "EmailAudience", + "outcomes": [], + "arguments": {}, + "configurationArguments": {}, + "metaData": { + "r__event_key": "DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e", + "chainType": "None", + "configurationRequired": false, + "iconUrl": "/images/icon-data-extension.svg", + "title": "Data Extension", + "entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json", + "sourceInteractionId": "00000000-0000-0000-0000-000000000000" + } + } + ], + "goals": [], + "exits": [], + "notifiers": [], + "entryMode": "NotSet", + "definitionType": "Multistep", + "channel": "", + "defaults": { + "email": ["{{Event.DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e.\"Email\"}}"], + "properties": { + "analyticsTracking": { + "enabled": true, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": { "dataSource": "ContactsModel", "highThroughputSending": { "email": false } }, + "executionMode": "Production", + "status": "Draft", + "scheduledStatus": "Draft", + "r__folder_Path": "my journeys" +} diff --git a/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_temail.journey-meta.json b/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_temail.journey-meta.json new file mode 100644 index 000000000..a5436a85c --- /dev/null +++ b/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_temail.journey-meta.json @@ -0,0 +1,212 @@ +{ + "key": "testExisting_temail", + "name": "testExisting_temail", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2022-03-24T02:20:32.74", + "modifiedDate": "2022-03-24T02:20:40.45", + "activities": [ + { + "id": "9606bcb0-9246-4610-9800-963bc77fc20a", + "key": "EMAILV2-4", + "name": "testExisting_temail", + "description": "", + "type": "EMAILV2", + "outcomes": [ + { + "key": "1f44021a-74ac-49be-a07c-67862228214d", + "arguments": {}, + "metaData": { "invalid": false } + } + ], + "arguments": {}, + "configurationArguments": { + "applicationExtensionKey": "jb-email-activity", + "isModified": true, + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": [], + "ccEmail": [], + "created": {}, + "domainExclusions": [], + "dynamicEmailSubject": "test email", + "emailSubject": "test email", + "exclusionFilter": "", + "isSalesforceTracking": true, + "isMultipart": true, + "isSendLogging": false, + "isStoppedOnJobError": false, + "modified": {}, + "preHeader": "", + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "isTrackingClicks": true, + "r__list_PathName": { "publicationList": "my subscribers/All Subscribers" }, + "r__deliveryProfile_key": "Default", + "r__senderProfile_key": "Default", + "r__sendClassification_key": "Default Transactional", + "c__priority": "Medium", + "r__asset_name_readOnly": "testExisting_asset_message", + "r__asset_key": "testExisting_asset_message" + }, + "r__transactionalEmail_key": "testExisting_temail" + }, + "metaData": { + "highThroughput": { "r__dataExtension_key": "testExisting_dataExtension" }, + "sections": {}, + "isConfigured": true + }, + "schema": { + "arguments": { + "requestID": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "messageKey": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "activityId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "definitionId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "emailSubjectDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "contactId": { + "dataType": "Number", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "contactKey": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "emailAddress": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "fieldType": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "eventData": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "obfuscationProperties": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "definitionInstanceId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + } + ], + "triggers": [ + { + "key": "TRIGGER", + "name": "TRIGGER", + "description": "", + "type": "transactional-api", + "outcomes": [], + "arguments": {}, + "configurationArguments": {}, + "metaData": { + "chainType": "none", + "configurationRequired": false, + "iconUrl": "/images/icon_journeyBuilder-event-transactional-blue.svg", + "title": "Transactional API Event", + "category": "Transactional", + "entrySourceGroupConfigUrl": "null" + } + } + ], + "goals": [], + "exits": [], + "notifiers": [], + "entryMode": "MultipleEntries", + "definitionType": "Transactional", + "channel": "email", + "defaults": { + "properties": { + "analyticsTracking": { + "enabled": false, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": {}, + "executionMode": "Production", + "status": "Published", + "scheduledStatus": "Draft", + "r__folder_Path": "my journeys" +} diff --git a/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_temail_notPublished.journey-meta.json b/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_temail_notPublished.journey-meta.json new file mode 100644 index 000000000..26357c013 --- /dev/null +++ b/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_temail_notPublished.journey-meta.json @@ -0,0 +1,217 @@ +{ + "activities": [ + { + "arguments": {}, + "configurationArguments": { + "applicationExtensionKey": "jb-email-activity", + "isModified": true, + "r__transactionalEmail_key": "testExisting_temail_notPublished", + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": [], + "c__priority": "Medium", + "ccEmail": [], + "created": {}, + "domainExclusions": [], + "dynamicEmailSubject": "%%=treatascontent(@subject)=%%", + "emailSubject": "%%=treatascontent(@subject)=%%", + "exclusionFilter": "", + "isMultipart": true, + "isSalesforceTracking": true, + "isSendLogging": false, + "isStoppedOnJobError": false, + "isTrackingClicks": true, + "modified": {}, + "preHeader": "%%=treatascontent(@preheader)=%%\n", + "r__asset_key": "testExisting_asset_message", + "r__asset_name_readOnly": "testExisting_asset_message", + "r__deliveryProfile_key": "Default", + "r__list_PathName": { + "publicationList": "my subscribers/All Subscribers" + }, + "r__sendClassification_key": "Default Transactional", + "r__senderProfile_key": "Default", + "throttleCloses": "1/1/0001 12:00:00 AM", + "throttleOpens": "1/1/0001 12:00:00 AM" + } + }, + "description": "", + "id": "4ae63473-ea1e-4963-a257-6fea45a9038a", + "key": "EMAILV2-3", + "metaData": { + "highThroughput": { + "r__dataExtension_key": "testExisting_temail_notPublished" + }, + "isConfigured": true, + "sections": {} + }, + "name": "my email activity", + "outcomes": [ + { + "arguments": {}, + "key": "067f20ba-af36-4401-99d8-934100e1935d", + "metaData": { + "invalid": false + } + } + ], + "schema": { + "arguments": { + "activityId": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": true, + "readOnly": false + }, + "contactId": { + "access": "Hidden", + "dataType": "Number", + "direction": "In", + "isNullable": true, + "readOnly": false + }, + "contactKey": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": false, + "readOnly": false + }, + "customObjectKey": { + "access": "Hidden", + "dataType": "LongNumber", + "direction": "In", + "isNullable": true, + "readOnly": true + }, + "definitionId": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": true, + "readOnly": true + }, + "definitionInstanceId": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": false, + "readOnly": false + }, + "emailAddress": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": false, + "readOnly": false + }, + "emailSubjectDataBound": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": true, + "readOnly": true + }, + "eventData": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": true, + "readOnly": false + }, + "fieldType": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": true, + "readOnly": false + }, + "messageKey": { + "access": "Hidden", + "dataType": "Text", + "direction": "Out", + "isNullable": true, + "readOnly": false + }, + "obfuscationProperties": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": true, + "readOnly": false + }, + "requestID": { + "access": "Hidden", + "dataType": "Text", + "direction": "Out", + "isNullable": true, + "readOnly": false + }, + "sourceCustomObjectId": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": true, + "readOnly": false + }, + "sourceCustomObjectKey": { + "access": "Hidden", + "dataType": "LongNumber", + "direction": "In", + "isNullable": true, + "readOnly": false + } + } + }, + "type": "EMAILV2" + } + ], + "channel": "email", + "createdDate": "2024-08-23T01:29:33.233", + "defaults": { + "properties": {} + }, + "definitionType": "Transactional", + "description": "", + "entryMode": "MultipleEntries", + "executionMode": "Production", + "exits": [], + "goals": [], + "key": "testExisting_temail_notPublished", + "lastPublishedDate": "0001-01-01T00:00:00", + "metaData": { + "dataSource": "ContactsModel", + "highThroughputSending": { + "email": false + } + }, + "modifiedDate": "2024-08-23T02:00:44.57", + "name": "testExisting_temail_notPublished", + "notifiers": [], + "r__folder_Path": "my journeys", + "scheduledStatus": "Draft", + "status": "Published", + "triggers": [ + { + "arguments": {}, + "configurationArguments": {}, + "description": "", + "key": "TRIGGER", + "metaData": { + "category": "Transactional", + "chainType": "none", + "configurationRequired": false, + "entrySourceGroupConfigUrl": "null", + "iconUrl": "/images/icon_journeyBuilder-event-transactional-blue.svg", + "title": "Transactional API Event" + }, + "name": "TRIGGER", + "outcomes": [], + "type": "transactional-api" + } + ], + "version": 1, + "workflowApiVersion": 1 +} diff --git a/test/resources/9999999/event/get-published-expected.json b/test/resources/9999999/event/get-published-expected.json new file mode 100644 index 000000000..01fedc723 --- /dev/null +++ b/test/resources/9999999/event/get-published-expected.json @@ -0,0 +1,30 @@ +{ + "type": "EmailAudience", + "name": "testExisting_journey_Multistep", + "description": "", + "createdDate": "2024-05-04T05:54:44.95", + "createdBy": "Jörn Berkefeld", + "modifiedDate": "2024-05-04T05:54:44.95", + "modifiedBy": "Jörn Berkefeld", + "eventDefinitionKey": "DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e", + "sourceApplicationExtensionId": "97e942ee-6914-4d3d-9e52-37ecb71f79ed", + "filterDefinitionId": "00000000-0000-0000-0000-000000000000", + "filterDefinitionTemplate": "", + "iconUrl": "/images/icon-data-extension.svg", + "configurationArguments": {}, + "arguments": { + "serializedObjectType": 3, + "criteria": "" + }, + "metaData": { + "criteriaDescription": "", + "scheduleState": "No Schedule" + }, + "interactionCount": 1, + "isVisibleInPicker": false, + "category": "Audience", + "publishedInteractionCount": 0, + "automationId": "00000000-0000-0000-0000-000000000000", + "disableDEDataLogging": false, + "r__dataExtension_key": "testExisting_journey_Multistep" +} diff --git a/test/resources/9999999/interaction/v1/eventDefinitions/key_DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e/get-response.json b/test/resources/9999999/interaction/v1/eventDefinitions/key_DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e/get-response.json new file mode 100644 index 000000000..355c083d7 --- /dev/null +++ b/test/resources/9999999/interaction/v1/eventDefinitions/key_DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e/get-response.json @@ -0,0 +1,39 @@ +{ + "id": "649d512b-4d08-4eca-a14e-fc7b64b4ada8", + "type": "EmailAudience", + "name": "testExisting_journey_Multistep", + "description": "", + "createdDate": "2024-05-04T05:54:44.95", + "createdBy": 700301950, + "modifiedDate": "2024-05-04T05:54:44.95", + "modifiedBy": 700301950, + "mode": "Production", + "eventDefinitionKey": "DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e", + "dataExtensionId": "ed305df3-6502-ef11-a5c8-5cba2c702db8", + "dataExtensionName": "testExisting_journey_Multistep", + "sourceApplicationExtensionId": "97e942ee-6914-4d3d-9e52-37ecb71f79ed", + "filterDefinitionId": "00000000-0000-0000-0000-000000000000", + "filterDefinitionTemplate": "", + "iconUrl": "/images/icon-data-extension.svg", + "arguments": { + "serializedObjectType": 3, + "eventDefinitionId": "649d512b-4d08-4eca-a14e-fc7b64b4ada8", + "eventDefinitionKey": "DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e", + "dataExtensionId": "ed305df3-6502-ef11-a5c8-5cba2c702db8", + "criteria": "" + }, + "configurationArguments": { + "unconfigured": true + }, + "metaData": { + "criteriaDescription": "", + "scheduleState": "No Schedule" + }, + "interactionCount": 1, + "isVisibleInPicker": false, + "isPlatformObject": false, + "category": "Audience", + "publishedInteractionCount": 0, + "automationId": "00000000-0000-0000-0000-000000000000", + "disableDEDataLogging": false +} diff --git a/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/put-response.json b/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/put-response.json new file mode 100644 index 000000000..b3a10af04 --- /dev/null +++ b/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/put-response.json @@ -0,0 +1,461 @@ +{ + "id": "0175b971-71a3-4d8e-98ac-48121f3fbf4f", + "key": "testExisting_journey_Multistep", + "name": "testExisting_journey_Multistep", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2024-05-04T05:54:48.027", + "modifiedDate": "2024-05-04T17:25:57.9", + "activities": [ + { + "id": "342dd0aa-a6be-401e-8614-3538800bfd7c", + "key": "MULTICRITERIADECISIONV2-1", + "name": "", + "description": "", + "type": "MULTICRITERIADECISION", + "outcomes": [ + { + "key": "default_path_1", + "next": "EMAILV2-1", + "arguments": {}, + "metaData": { + "label": "send message", + "skipI18n": true, + "isLabelFromConversion": false, + "criteriaDescription": "Email is not null" + } + }, + { + "key": "remainder_path", + "next": "WAITBYDURATION-2", + "arguments": {}, + "metaData": { + "label": null + } + } + ], + "arguments": {}, + "configurationArguments": { + "criteria": { + "default_path_1": "" + }, + "schemaVersionId": "252" + }, + "metaData": { + "isConfigured": true + }, + "schema": { + "arguments": { + "actualChoice": { + "dataType": "Number", + "isNullable": false, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "filterResult": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": true, + "access": "Hidden" + } + } + } + }, + { + "id": "7ba1e59a-6be4-46c7-b76f-4c06feb1268a", + "key": "EMAILV2-1", + "name": "my custom activity name", + "description": "", + "type": "EMAILV2", + "outcomes": [ + { + "key": "ff60a294-3804-4165-85cd-c7c19c8e3a6d", + "next": "WAITBYDURATION-1", + "arguments": {}, + "metaData": { + "invalid": false + } + } + ], + "arguments": {}, + "configurationArguments": { + "applicationExtensionKey": "jb-email-activity", + "isModified": true, + "googleAnalyticsCampaignName": "", + "triggeredSendId": "b3150cf0-6e78-e811-80d4-1402ec721c9d", + "triggeredSendKey": "wrong key", + "triggeredSend": { + "id": "outdated id", + "key": "outdated key", + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": "", + "ccEmail": "", + "created": { + "name": "", + "date": "" + }, + "description": "my custom description", + "domainExclusions": [], + "dynamicEmailSubject": "testExisting_ email subject", + "emailId": 808714, + "emailSubject": "testExisting_ email subject", + "exclusionFilter": "", + "isSalesforceTracking": false, + "isMultipart": true, + "isSendLogging": true, + "isStoppedOnJobError": false, + "modified": { + "name": "", + "date": "" + }, + "preHeader": "testExisting_ email preheader", + "priority": 4, + "sendClassificationId": "95da425b-a06f-e611-96fe-38eaa7142c61", + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "deliveryProfileId": "163f8417-13f7-e911-a2d8-1402ec938a35", + "senderProfileId": "a75d452b-7ef4-eb11-b82d-48df37d1da95", + "isTrackingClicks": true, + "publicationListId": 15 + } + }, + "metaData": { + "category": "message", + "version": "1.0", + "icon": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "iconSmall": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "statsContactIcon": null, + "original_icon": "/img/email-icon.svg", + "original_iconSmall": "/img/email-icon.svg", + "sections": {}, + "isConfigured": true + }, + "schema": { + "arguments": { + "requestID": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "messageKey": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "activityId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "definitionId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "emailSubjectDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "contactId": { + "dataType": "Number", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "contactKey": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "emailAddress": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "fieldType": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "eventData": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "obfuscationProperties": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "definitionInstanceId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + }, + { + "id": "70572b1a-e274-4f09-a3fa-6fc0732ec52b", + "key": "WAITBYDURATION-2", + "name": "", + "description": "", + "type": "WAIT", + "outcomes": [ + { + "key": "a0908f9f-bc3c-47f7-9489-7fef5af25ce3", + "arguments": {}, + "metaData": { + "invalid": false + } + } + ], + "arguments": {}, + "configurationArguments": { + "waitDuration": 1, + "waitUnit": "DAYS" + }, + "metaData": { + "isConfigured": true, + "uiType": "WAITBYDURATION" + }, + "schema": { + "arguments": { + "endDate": { + "dataType": "Date", + "isNullable": false, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "waitEndDateAttributeDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitDefinitionId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitForEventId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "executionMode": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "startActivityKey": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitQueueId": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + }, + { + "id": "e2a486cf-c85f-4543-88a2-d579cac1e0de", + "key": "WAITBYDURATION-1", + "name": "1 day", + "description": "", + "type": "WAIT", + "outcomes": [ + { + "key": "97af222a-450a-429e-8925-649b72f01ccf", + "arguments": {}, + "metaData": { + "invalid": false + } + } + ], + "arguments": {}, + "configurationArguments": { + "waitDuration": 1, + "waitUnit": "DAYS" + }, + "metaData": { + "isConfigured": true, + "uiType": "WAITBYDURATION" + }, + "schema": { + "arguments": { + "endDate": { + "dataType": "Date", + "isNullable": false, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "waitEndDateAttributeDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitDefinitionId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitForEventId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "executionMode": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "startActivityKey": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitQueueId": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + } + ], + "triggers": [ + { + "id": "92753481-1258-49bd-8a84-921ed63bcc2e", + "key": "TRIGGER", + "name": "TRIGGER", + "description": "", + "type": "EmailAudience", + "outcomes": [], + "arguments": {}, + "configurationArguments": {}, + "metaData": { + "eventDefinitionId": "649d512b-4d08-4eca-a14e-fc7b64b4ada8", + "eventDefinitionKey": "DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e", + "chainType": "None", + "configurationRequired": false, + "iconUrl": "/images/icon-data-extension.svg", + "title": "Data Extension", + "entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json", + "sourceInteractionId": "00000000-0000-0000-0000-000000000000" + } + } + ], + "goals": [], + "exits": [], + "notifiers": [], + "stats": { + "currentPopulation": 0, + "cumulativePopulation": 0, + "metGoal": 0, + "metExitCriteria": 0, + "goalPerformance": 0 + }, + "entryMode": "NotSet", + "definitionType": "Multistep", + "channel": "", + "defaults": { + "email": ["{{Event.DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e.\"Email\"}}"], + "properties": { + "analyticsTracking": { + "enabled": true, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": { + "dataSource": "ContactsModel", + "highThroughputSending": { + "email": false + } + }, + "executionMode": "Production", + "categoryId": 6298, + "status": "Draft", + "definitionId": "0175b971-71a3-4d8e-98ac-48121f3fbf4f", + "scheduledStatus": "Draft" +} diff --git a/test/resources/9999999/interaction/v1/interactions/key_testExisting_temail/put-response.json b/test/resources/9999999/interaction/v1/interactions/key_testExisting_temail/put-response.json new file mode 100644 index 000000000..8427da85d --- /dev/null +++ b/test/resources/9999999/interaction/v1/interactions/key_testExisting_temail/put-response.json @@ -0,0 +1,219 @@ +{ + "id": "dsfdsafdsa-922c-4568-85a5-e5cc77efc3be", + "key": "testExisting_temail", + "name": "testExisting_temail", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2022-03-24T02:20:32.74", + "modifiedDate": "2022-03-24T02:20:40.45", + "activities": [ + { + "id": "9606bcb0-9246-4610-9800-963bc77fc20a", + "key": "EMAILV2-4", + "name": "testExisting_temail", + "description": "", + "type": "EMAILV2", + "outcomes": [ + { + "key": "1f44021a-74ac-49be-a07c-67862228214d", + "arguments": {}, + "metaData": { + "invalid": false + } + } + ], + "arguments": {}, + "configurationArguments": { + "applicationExtensionKey": "jb-email-activity", + "isModified": true, + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": "", + "ccEmail": "", + "created": {}, + "domainExclusions": [], + "dynamicEmailSubject": "test email", + "emailId": 531213, + "emailSubject": "test email", + "exclusionFilter": "", + "isSalesforceTracking": true, + "isMultipart": true, + "isSendLogging": false, + "isStoppedOnJobError": false, + "modified": {}, + "preHeader": "", + "priority": 4, + "sendClassificationId": "95da425b-a06f-e611-96fe-38eaa7142c61", + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "deliveryProfileId": "163f8417-13f7-e911-a2d8-1402ec938a35", + "senderProfileId": "a75d452b-7ef4-eb11-b82d-48df37d1da95", + "isTrackingClicks": true, + "publicationListId": 15 + }, + "triggeredSendId": "0a650d90-755e-ed11-b852-48df37d1df5b", + "triggeredSendKey": "testExisting_temail" + }, + "metaData": { + "highThroughput": { + "definitionKey": "testExisting_temail", + "dataExtensionId": "21711373-72c1-ec11-b83b-48df37d1deb7" + }, + "sections": {}, + "isConfigured": true + }, + "schema": { + "arguments": { + "requestID": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "messageKey": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "activityId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "definitionId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "emailSubjectDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "contactId": { + "dataType": "Number", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "contactKey": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "emailAddress": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "fieldType": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "eventData": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "obfuscationProperties": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "definitionInstanceId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + } + ], + "triggers": [ + { + "key": "TRIGGER", + "name": "TRIGGER", + "description": "", + "type": "transactional-api", + "outcomes": [], + "arguments": {}, + "configurationArguments": {}, + "metaData": { + "chainType": "none", + "configurationRequired": false, + "iconUrl": "/images/icon_journeyBuilder-event-transactional-blue.svg", + "title": "Transactional API Event", + "category": "Transactional", + "entrySourceGroupConfigUrl": "null" + } + } + ], + "goals": [], + "exits": [], + "notifiers": [], + "entryMode": "MultipleEntries", + "definitionType": "Transactional", + "channel": "email", + "defaults": { + "properties": { + "analyticsTracking": { + "enabled": false, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": {}, + "executionMode": "Production", + "categoryId": 6298, + "status": "Published", + "scheduledStatus": "Draft", + "definitionId": "dsfdsafdsa-922c-4568-85a5-e5cc77efc3be" +} diff --git a/test/resources/9999999/interaction/v1/interactions/key_testExisting_temail_notPublished/put-response.json b/test/resources/9999999/interaction/v1/interactions/key_testExisting_temail_notPublished/put-response.json new file mode 100644 index 000000000..6d57ebdd2 --- /dev/null +++ b/test/resources/9999999/interaction/v1/interactions/key_testExisting_temail_notPublished/put-response.json @@ -0,0 +1,226 @@ +{ + "id": "d4a900fe-3a8f-4cc5-9a49-81286e3e2cd2", + "key": "testExisting_temail_notPublished", + "name": "testExisting_temail_notPublished", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2024-08-23T01:29:33.233", + "modifiedDate": "2024-08-23T02:00:44.57", + "activities": [ + { + "id": "4ae63473-ea1e-4963-a257-6fea45a9038a", + "key": "EMAILV2-3", + "name": "my email activity", + "description": "", + "type": "EMAILV2", + "outcomes": [ + { + "key": "067f20ba-af36-4401-99d8-934100e1935d", + "arguments": {}, + "metaData": { + "invalid": false + } + } + ], + "arguments": {}, + "configurationArguments": { + "applicationExtensionKey": "jb-email-activity", + "isModified": true, + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": "", + "ccEmail": "", + "created": {}, + "domainExclusions": [], + "dynamicEmailSubject": "%%=treatascontent(@subject)=%%", + "emailId": 531213, + "emailSubject": "%%=treatascontent(@subject)=%%", + "exclusionFilter": "", + "isSalesforceTracking": true, + "isMultipart": true, + "isSendLogging": false, + "isStoppedOnJobError": false, + "modified": {}, + "preHeader": "%%=treatascontent(@preheader)=%%\n", + "priority": 4, + "sendClassificationId": "95da425b-a06f-e611-96fe-38eaa7142c61", + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "deliveryProfileId": "163f8417-13f7-e911-a2d8-1402ec938a35", + "senderProfileId": "a75d452b-7ef4-eb11-b82d-48df37d1da95", + "isTrackingClicks": true, + "publicationListId": 15 + }, + "triggeredSendId": "6a2f70c5-2561-ef11-b876-f40343c95928", + "triggeredSendKey": "testExisting_temail_notPublished" + }, + "metaData": { + "highThroughput": { + "definitionKey": "testExisting_temail_notPublished", + "dataExtensionId": "3c3a54a5-d55f-ef11-b876-f40343c95928" + }, + "isConfigured": true, + "sections": {} + }, + "schema": { + "arguments": { + "requestID": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "messageKey": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "activityId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "definitionId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "emailSubjectDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "contactId": { + "dataType": "Number", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "contactKey": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "emailAddress": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "fieldType": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "eventData": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "obfuscationProperties": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "definitionInstanceId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + } + ], + "triggers": [ + { + "id": "64a93832-fd23-487e-b585-8f3af3b5b6eb", + "key": "TRIGGER", + "name": "TRIGGER", + "description": "", + "type": "transactional-api", + "outcomes": [], + "arguments": {}, + "configurationArguments": {}, + "metaData": { + "chainType": "none", + "configurationRequired": false, + "iconUrl": "/images/icon_journeyBuilder-event-transactional-blue.svg", + "title": "Transactional API Event", + "category": "Transactional", + "entrySourceGroupConfigUrl": "null" + } + } + ], + "goals": [], + "exits": [], + "notifiers": [], + "stats": { + "currentPopulation": 0, + "cumulativePopulation": 0, + "metGoal": 0, + "metExitCriteria": 0, + "goalPerformance": 0 + }, + "entryMode": "MultipleEntries", + "definitionType": "Transactional", + "channel": "email", + "defaults": { + "properties": {} + }, + "metaData": { + "dataSource": "ContactsModel", + "highThroughputSending": { + "email": false + } + }, + "executionMode": "Production", + "categoryId": 6298, + "status": "Draft", + "definitionId": "d4a900fe-3a8f-4cc5-9a49-81286e3e2cd2", + "scheduledStatus": "Draft" +} diff --git a/test/resources/9999999/journey/get-published-expected.json b/test/resources/9999999/journey/get-published-expected.json new file mode 100644 index 000000000..26357c013 --- /dev/null +++ b/test/resources/9999999/journey/get-published-expected.json @@ -0,0 +1,217 @@ +{ + "activities": [ + { + "arguments": {}, + "configurationArguments": { + "applicationExtensionKey": "jb-email-activity", + "isModified": true, + "r__transactionalEmail_key": "testExisting_temail_notPublished", + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": [], + "c__priority": "Medium", + "ccEmail": [], + "created": {}, + "domainExclusions": [], + "dynamicEmailSubject": "%%=treatascontent(@subject)=%%", + "emailSubject": "%%=treatascontent(@subject)=%%", + "exclusionFilter": "", + "isMultipart": true, + "isSalesforceTracking": true, + "isSendLogging": false, + "isStoppedOnJobError": false, + "isTrackingClicks": true, + "modified": {}, + "preHeader": "%%=treatascontent(@preheader)=%%\n", + "r__asset_key": "testExisting_asset_message", + "r__asset_name_readOnly": "testExisting_asset_message", + "r__deliveryProfile_key": "Default", + "r__list_PathName": { + "publicationList": "my subscribers/All Subscribers" + }, + "r__sendClassification_key": "Default Transactional", + "r__senderProfile_key": "Default", + "throttleCloses": "1/1/0001 12:00:00 AM", + "throttleOpens": "1/1/0001 12:00:00 AM" + } + }, + "description": "", + "id": "4ae63473-ea1e-4963-a257-6fea45a9038a", + "key": "EMAILV2-3", + "metaData": { + "highThroughput": { + "r__dataExtension_key": "testExisting_temail_notPublished" + }, + "isConfigured": true, + "sections": {} + }, + "name": "my email activity", + "outcomes": [ + { + "arguments": {}, + "key": "067f20ba-af36-4401-99d8-934100e1935d", + "metaData": { + "invalid": false + } + } + ], + "schema": { + "arguments": { + "activityId": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": true, + "readOnly": false + }, + "contactId": { + "access": "Hidden", + "dataType": "Number", + "direction": "In", + "isNullable": true, + "readOnly": false + }, + "contactKey": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": false, + "readOnly": false + }, + "customObjectKey": { + "access": "Hidden", + "dataType": "LongNumber", + "direction": "In", + "isNullable": true, + "readOnly": true + }, + "definitionId": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": true, + "readOnly": true + }, + "definitionInstanceId": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": false, + "readOnly": false + }, + "emailAddress": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": false, + "readOnly": false + }, + "emailSubjectDataBound": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": true, + "readOnly": true + }, + "eventData": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": true, + "readOnly": false + }, + "fieldType": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": true, + "readOnly": false + }, + "messageKey": { + "access": "Hidden", + "dataType": "Text", + "direction": "Out", + "isNullable": true, + "readOnly": false + }, + "obfuscationProperties": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": true, + "readOnly": false + }, + "requestID": { + "access": "Hidden", + "dataType": "Text", + "direction": "Out", + "isNullable": true, + "readOnly": false + }, + "sourceCustomObjectId": { + "access": "Hidden", + "dataType": "Text", + "direction": "In", + "isNullable": true, + "readOnly": false + }, + "sourceCustomObjectKey": { + "access": "Hidden", + "dataType": "LongNumber", + "direction": "In", + "isNullable": true, + "readOnly": false + } + } + }, + "type": "EMAILV2" + } + ], + "channel": "email", + "createdDate": "2024-08-23T01:29:33.233", + "defaults": { + "properties": {} + }, + "definitionType": "Transactional", + "description": "", + "entryMode": "MultipleEntries", + "executionMode": "Production", + "exits": [], + "goals": [], + "key": "testExisting_temail_notPublished", + "lastPublishedDate": "0001-01-01T00:00:00", + "metaData": { + "dataSource": "ContactsModel", + "highThroughputSending": { + "email": false + } + }, + "modifiedDate": "2024-08-23T02:00:44.57", + "name": "testExisting_temail_notPublished", + "notifiers": [], + "r__folder_Path": "my journeys", + "scheduledStatus": "Draft", + "status": "Published", + "triggers": [ + { + "arguments": {}, + "configurationArguments": {}, + "description": "", + "key": "TRIGGER", + "metaData": { + "category": "Transactional", + "chainType": "none", + "configurationRequired": false, + "entrySourceGroupConfigUrl": "null", + "iconUrl": "/images/icon_journeyBuilder-event-transactional-blue.svg", + "title": "Transactional API Event" + }, + "name": "TRIGGER", + "outcomes": [], + "type": "transactional-api" + } + ], + "version": 1, + "workflowApiVersion": 1 +} diff --git a/test/type.journey.test.js b/test/type.journey.test.js index 293125d2f..0896a46af 100644 --- a/test/type.journey.test.js +++ b/test/type.journey.test.js @@ -217,6 +217,160 @@ describe('type: journey', () => { ); return; }); + + it('Should deploy --publish a transactional journey', async () => { + // WHEN + handler.setOptions({ skipStatusCheck: true, publish: true }); + const deploy = await handler.deploy( + 'testInstance/testBU', + ['journey'], + ['testExisting_temail_notPublished'] + ); + + // THEN + assert.equal(process.exitCode, 0, 'deploy --publish should not have thrown an error'); + // retrieve result + assert.deepEqual( + Object.keys(deploy['testInstance/testBU']?.journey), + ['testExisting_temail_notPublished'], + 'should have published the right journey' + ); + + // get callouts + const publishCallout = testUtils.getRestCallout( + 'post', + '/interaction/v1/interactions/transactional/create' + ); + // confirm callouts + assert.deepEqual( + publishCallout, + { + definitionId: 'd4a900fe-3a8f-4cc5-9a49-81286e3e2cd2', + }, + 'publish-payload JSON was not equal expected' + ); + + // confirm transactionalEmail was downloaded + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_temail_notPublished', + 'transactionalEmail' + ), + await testUtils.getExpectedJson('9999999', 'transactionalEmail', 'get-published'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 57, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should deploy --publish an already published transactional journey and refresh it', async () => { + // WHEN + handler.setOptions({ skipStatusCheck: true, publish: true }); + const deploy = await handler.deploy( + 'testInstance/testBU', + ['journey'], + ['testExisting_temail'] + ); + + // THEN + assert.equal(process.exitCode, 0, 'deploy --publish should not have thrown an error'); + // retrieve result + assert.deepEqual( + Object.keys(deploy['testInstance/testBU']?.journey), + ['testExisting_temail'], + 'should have published the right journey' + ); + + // get callouts + const pauseCallout = testUtils.getRestCallout( + 'post', + '/interaction/v1/interactions/transactional/pause' + ); + const resumeCallout = testUtils.getRestCallout( + 'post', + '/interaction/v1/interactions/transactional/pause' + ); + // confirm callouts + assert.deepEqual( + pauseCallout, + { + definitionId: 'dsfdsafdsa-922c-4568-85a5-e5cc77efc3be', + }, + 'pause-payload JSON was not equal expected' + ); + assert.deepEqual( + resumeCallout, + { + definitionId: 'dsfdsafdsa-922c-4568-85a5-e5cc77efc3be', + }, + 'resume-payload JSON was not equal expected' + ); + + // confirm transactionalEmail was downloaded + // assert.deepEqual( + // await testUtils.getActualJson('testExisting_temail', 'transactionalEmail'), + // await testUtils.getExpectedJson('9999999', 'transactionalEmail', 'get'), + // 'returned JSON was not equal expected' + // ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 26, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should deploy --publish a journey by key (auto-picks latest version)', async () => { + handler.setOptions({ skipStatusCheck: true, publish: true }); + // WHEN + const deploy = await handler.deploy( + 'testInstance/testBU', + ['journey'], + ['testExisting_journey_Multistep'] + ); + // THEN + assert.equal(process.exitCode, 0, 'publish should not have thrown an error'); + // retrieve result + assert.deepEqual( + Object.keys(deploy['testInstance/testBU']?.journey), + ['testExisting_journey_Multistep'], + 'should have published the right journey' + ); + + // get callouts + const publishCallout = testUtils.getRestCallout( + 'post', + '/interaction/v1/interactions/publishAsync/%' + ); + // confirm created item + assert.deepEqual( + publishCallout, + await testUtils.getExpectedJson('9999999', 'journey', 'publish-callout'), + 'publish-payload JSON was not equal expected' + ); + // confirm event was downloaded + assert.deepEqual( + await testUtils.getActualJson( + 'DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e', + 'event' + ), + await testUtils.getExpectedJson('9999999', 'event', 'get-published'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 50, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); }); describe('Templating ================', () => { @@ -603,6 +757,11 @@ describe('type: journey', () => { }, 'publish-payload JSON was not equal expected' ); + assert.deepEqual( + await testUtils.getActualJson('testExisting_temail_notPublished', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-published'), + 'returned JSON was not equal expected' + ); // confirm transactionalEmail was downloaded assert.deepEqual( @@ -650,10 +809,19 @@ describe('type: journey', () => { await testUtils.getExpectedJson('9999999', 'journey', 'publish-callout'), 'publish-payload JSON was not equal expected' ); + // confirm event was downloaded + assert.deepEqual( + await testUtils.getActualJson( + 'DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e', + 'event' + ), + await testUtils.getExpectedJson('9999999', 'event', 'get-published'), + 'returned JSON was not equal expected' + ); assert.equal( testUtils.getAPIHistoryLength(), - 2, + 31, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -687,9 +855,18 @@ describe('type: journey', () => { await testUtils.getExpectedJson('9999999', 'journey', 'publish-callout'), 'publish-payload JSON was not equal expected' ); + // confirm event was downloaded + assert.deepEqual( + await testUtils.getActualJson( + 'DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e', + 'event' + ), + await testUtils.getExpectedJson('9999999', 'event', 'get-published'), + 'returned JSON was not equal expected' + ); assert.equal( testUtils.getAPIHistoryLength(), - 2, + 31, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -726,7 +903,7 @@ describe('type: journey', () => { assert.equal( testUtils.getAPIHistoryLength(), - 2, + 31, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -807,10 +984,19 @@ describe('type: journey', () => { await testUtils.getExpectedJson('9999999', 'journey', 'publish-callout'), 'publish-payload JSON was not equal expected' ); + // confirm event was downloaded + assert.deepEqual( + await testUtils.getActualJson( + 'DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e', + 'event' + ), + await testUtils.getExpectedJson('9999999', 'event', 'get-published'), + 'returned JSON was not equal expected' + ); assert.equal( testUtils.getAPIHistoryLength(), - 3, + 32, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -849,10 +1035,19 @@ describe('type: journey', () => { await testUtils.getExpectedJson('9999999', 'journey', 'publish-callout'), 'publish-payload JSON was not equal expected' ); + // confirm event was downloaded + assert.deepEqual( + await testUtils.getActualJson( + 'DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e', + 'event' + ), + await testUtils.getExpectedJson('9999999', 'event', 'get-published'), + 'returned JSON was not equal expected' + ); assert.equal( testUtils.getAPIHistoryLength(), - 3, + 32, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return;