diff --git a/test/resources/9999999/automation/patch_fixKeys-pause-expected.json b/test/resources/9999999/automation/patch_fixKeys-pause-expected.json new file mode 100644 index 000000000..67ad413f2 --- /dev/null +++ b/test/resources/9999999/automation/patch_fixKeys-pause-expected.json @@ -0,0 +1,44 @@ +{ + "description": "testing fixKey on an a paused automation", + "key": "testExisting_automation_fixedKey_paused", + "name": "testExisting_automation_fixedKey_paused", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ] + } + ], + "type": "scheduled" +} diff --git a/test/resources/9999999/automation/patch_fixKeys-expected.json b/test/resources/9999999/automation/patch_fixKeys-schedule-expected.json similarity index 85% rename from test/resources/9999999/automation/patch_fixKeys-expected.json rename to test/resources/9999999/automation/patch_fixKeys-schedule-expected.json index 65a3a3c3a..7ac22ba98 100644 --- a/test/resources/9999999/automation/patch_fixKeys-expected.json +++ b/test/resources/9999999/automation/patch_fixKeys-schedule-expected.json @@ -1,7 +1,7 @@ { - "description": "updated on deploy", - "key": "testExisting_automation_paused", - "name": "testExisting_automation_paused", + "description": "testing fixKey on an a scheduled automation", + "key": "testExisting_automation_fixedKey_scheduled", + "name": "testExisting_automation_fixedKey_scheduled", "r__folder_Path": "my automations", "schedule": { "endDate": "2022-07-30T00:00:00", @@ -37,8 +37,7 @@ "name": "testExisting_script", "r__type": "script" } - ], - "name": "" + ] } ], "type": "scheduled" diff --git a/test/resources/9999999/automation/perform-08afb0e2-b00a-4c88-ad2e-pause-response.xml b/test/resources/9999999/automation/perform-08afb0e2-b00a-4c88-fixKey_pause-response.xml similarity index 92% rename from test/resources/9999999/automation/perform-08afb0e2-b00a-4c88-ad2e-pause-response.xml rename to test/resources/9999999/automation/perform-08afb0e2-b00a-4c88-fixKey_pause-response.xml index 1290defa5..d301c7cee 100644 --- a/test/resources/9999999/automation/perform-08afb0e2-b00a-4c88-ad2e-pause-response.xml +++ b/test/resources/9999999/automation/perform-08afb0e2-b00a-4c88-fixKey_pause-response.xml @@ -25,8 +25,8 @@ Performed Activity - 08afb0e2-b00a-4c88-ad2e-pause - testExisting_automation_paused + 08afb0e2-b00a-4c88-fixKey_pause + testExisting_automation_fixedKey_paused false diff --git a/test/resources/9999999/automation/perform-08afb0e2-b00a-4c88-fixKey_schedule-response.xml b/test/resources/9999999/automation/perform-08afb0e2-b00a-4c88-fixKey_schedule-response.xml new file mode 100644 index 000000000..c1c9e7685 --- /dev/null +++ b/test/resources/9999999/automation/perform-08afb0e2-b00a-4c88-fixKey_schedule-response.xml @@ -0,0 +1,42 @@ + + + + PerformResponse + urn:uuid:cc45bb83-15a3-4a82-ba48-47ac4fb13000 + urn:uuid:29986848-a0c3-4f3b-bf5a-91151f784449 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-02T13:41:30Z + 2023-06-02T13:46:30Z + + + + + + + + OK + Performed Activity + + + 08afb0e2-b00a-4c88-fixKey_schedule + testExisting_automation_fixedKey_scheduled + false + + + true + + + + OK + + 898702fc-a432-4176-8130-5d6dd5ad9ca6 + + + diff --git a/test/resources/9999999/automation/schedule-08afb0e2-b00a-4c88-fixKey_pause-response.xml b/test/resources/9999999/automation/schedule-08afb0e2-b00a-4c88-fixKey_pause-response.xml new file mode 100644 index 000000000..06deeccde --- /dev/null +++ b/test/resources/9999999/automation/schedule-08afb0e2-b00a-4c88-fixKey_pause-response.xml @@ -0,0 +1,52 @@ + + + + ScheduleResponse + urn:uuid:b58a82d9-a251-4be4-b50c-bd300d71601d + urn:uuid:9d3dbeb3-68b7-4f0a-b0af-04855dc0fd1e + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-07-05T10:29:58Z + 2023-07-05T10:34:58Z + + + + + + + + OK + Program scheduled. + 3a677ca8-5423-4d59-a1bb-c5fbe1c87197 + + + + + Interval + 1 + + Daily + EndAfter + 2023-07-05T16:00:57 + 1 + + + 5 + + + + + + + OK + + cfe97488-3c5e-49a9-b338-c0e9f6b6f684 + + + diff --git a/test/resources/9999999/automation/schedule-08afb0e2-b00a-4c88-fixKey_schedule-response.xml b/test/resources/9999999/automation/schedule-08afb0e2-b00a-4c88-fixKey_schedule-response.xml new file mode 100644 index 000000000..06deeccde --- /dev/null +++ b/test/resources/9999999/automation/schedule-08afb0e2-b00a-4c88-fixKey_schedule-response.xml @@ -0,0 +1,52 @@ + + + + ScheduleResponse + urn:uuid:b58a82d9-a251-4be4-b50c-bd300d71601d + urn:uuid:9d3dbeb3-68b7-4f0a-b0af-04855dc0fd1e + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-07-05T10:29:58Z + 2023-07-05T10:34:58Z + + + + + + + + OK + Program scheduled. + 3a677ca8-5423-4d59-a1bb-c5fbe1c87197 + + + + + Interval + 1 + + Daily + EndAfter + 2023-07-05T16:00:57 + 1 + + + 5 + + + + + + + OK + + cfe97488-3c5e-49a9-b338-c0e9f6b6f684 + + + diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-pause/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-pause/get-response.json index 6a736195e..58ec6b51c 100644 --- a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-pause/get-response.json +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-pause/get-response.json @@ -1,6 +1,6 @@ { "id": "08afb0e2-b00a-4c88-ad2e-pause", - "name": "testExisting_automation_paused", + "name": "testExisting_automation_pause", "description": "bla bla", "key": "testExisting_automation_pause", "typeId": 1, diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-pause/patch-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-pause/patch-response.json index b228f34b9..2454567e8 100644 --- a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-pause/patch-response.json +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-pause/patch-response.json @@ -1,8 +1,8 @@ { "legacyId": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow-PAUSED", - "name": "testExisting_automation_paused", + "name": "testExisting_automation_pause", "description": "updated on deploy", - "key": "testExisting_automation_paused", + "key": "testExisting_automation_pause", "typeId": 1, "type": "scheduled", "statusId": 4, diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-fixKey_pause/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-fixKey_pause/get-response.json new file mode 100644 index 000000000..17e4c6c2e --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-fixKey_pause/get-response.json @@ -0,0 +1,85 @@ +{ + "id": "08afb0e2-b00a-4c88-fixKey_pause", + "name": "testExisting_automation_fixedKey_paused", + "description": "testing fixKey on an a paused automation", + "key": "testExisting_automation_fixKey_pause", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "paused", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-fixKey_pause/patch-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-fixKey_pause/patch-response.json new file mode 100644 index 000000000..90720a384 --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-fixKey_pause/patch-response.json @@ -0,0 +1,85 @@ +{ + "id": "08afb0e2-b00a-4c88-fixKey_pause", + "name": "testExisting_automation_fixedKey_paused", + "description": "testing fixKey on an a paused automation", + "key": "testExisting_automation_fixedKey_paused", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "paused", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-fixKey_schedule/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-fixKey_schedule/get-response.json new file mode 100644 index 000000000..5f88c6f78 --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-fixKey_schedule/get-response.json @@ -0,0 +1,85 @@ +{ + "id": "08afb0e2-b00a-4c88-fixKey_schedule", + "name": "testExisting_automation_fixedKey_scheduled", + "description": "testing fixKey on an a scheduled automation", + "key": "testExisting_automation_fixKey_schedule", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "Scheduled", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "paused", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-fixKey_schedule/patch-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-fixKey_schedule/patch-response.json new file mode 100644 index 000000000..aedf780bb --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-fixKey_schedule/patch-response.json @@ -0,0 +1,85 @@ +{ + "id": "08afb0e2-b00a-4c88-fixKey_schedule", + "name": "testExisting_automation_fixedKey_scheduled", + "description": "testing fixKey on an a scheduled automation", + "key": "testExisting_automation_fixedKey_scheduled", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "Scheduled", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "paused", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ] +} diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_paused-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_fixKey_pause-response.xml similarity index 82% rename from test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_paused-response.xml rename to test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_fixKey_pause-response.xml index 5a1951d5f..b5b72f81b 100644 --- a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_paused-response.xml +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_fixKey_pause-response.xml @@ -23,9 +23,9 @@ 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 - 08afb0e2-b00a-4c88-ad2e-pause - testExisting_automation_paused - testExisting_automation_paused + 08afb0e2-b00a-4c88-fixKey_pause + testExisting_automation_fixedKey_paused + testExisting_automation_fixKey_pause diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_fixKey_schedule-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_fixKey_schedule-response.xml new file mode 100644 index 000000000..86773f622 --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_fixKey_schedule-response.xml @@ -0,0 +1,32 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-fixKey_schedule + testExisting_automation_fixedKey_scheduled + testExisting_automation_fixKey_schedule + + + + diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_fixedKey_paused-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_fixedKey_paused-response.xml new file mode 100644 index 000000000..ce6885409 --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_fixedKey_paused-response.xml @@ -0,0 +1,32 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-fixKey_pause + testExisting_automation_fixedKey_paused + testExisting_automation_fixedKey_paused + + + + diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_fixedKey_scheduled-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_fixedKey_scheduled-response.xml new file mode 100644 index 000000000..a1517f9db --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_fixedKey_scheduled-response.xml @@ -0,0 +1,32 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-fixKey_schedule + testExisting_automation_fixedKey_scheduled + testExisting_automation_fixedKey_scheduled + + + + diff --git a/test/resources/9999999/program/retrieve-response.xml b/test/resources/9999999/program/retrieve-response.xml index bcb9045c8..6490d5491 100644 --- a/test/resources/9999999/program/retrieve-response.xml +++ b/test/resources/9999999/program/retrieve-response.xml @@ -33,6 +33,18 @@ testExisting_automation_pause testExisting_automation_pause + + + 08afb0e2-b00a-4c88-fixKey_schedule + testExisting_automation_fixedKey_scheduled + testExisting_automation_fixKey_schedule + + + + 08afb0e2-b00a-4c88-fixKey_pause + testExisting_automation_fixedKey_paused + testExisting_automation_fixKey_pause + diff --git a/test/type.automation.test.js b/test/type.automation.test.js index c68e0a5d2..20e872170 100644 --- a/test/type.automation.test.js +++ b/test/type.automation.test.js @@ -27,8 +27,8 @@ describe('type: automation', () => { const result = cache.getCache(); assert.equal( result.automation ? Object.keys(result.automation).length : 0, - 2, - 'only two automations expected' + 4, + 'only four automations expected' ); assert.deepEqual( await testUtils.getActualJson('testExisting_automation', 'automation'), @@ -50,7 +50,7 @@ describe('type: automation', () => { assert.equal( testUtils.getAPIHistoryLength(), - 15, + 17, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -62,15 +62,24 @@ describe('type: automation', () => { }); it('Should create & update a automation', async () => { // WHEN - await handler.deploy('testInstance/testBU', ['automation']); + const deployResult = await handler.deploy('testInstance/testBU', ['automation']); // THEN assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + // check how many items were deployed + assert.equal( + deployResult['testInstance/testBU']?.automation + ? Object.keys(deployResult['testInstance/testBU']?.automation).length + : 0, + 2, + 'two automations to be deployed' + ); + // get results from cache - const result = cache.getCache(); + const cacheResult = cache.getCache(); assert.equal( - result.automation ? Object.keys(result.automation).length : 0, - 3, + cacheResult.automation ? Object.keys(cacheResult.automation).length : 0, + 5, 'three automations expected' ); // insert @@ -135,8 +144,8 @@ describe('type: automation', () => { const cached = cache.getCache(); assert.equal( cached.automation ? Object.keys(cached.automation).length : 0, - 3, - 'three cached automation expected' + 5, + 'five cached automation expected' ); assert.equal( deployed['testInstance/testBU'].automation @@ -204,8 +213,8 @@ describe('type: automation', () => { const cached = cache.getCache(); assert.equal( cached.automation ? Object.keys(cached.automation).length : 0, - 3, - 'three cached automation expected' + 5, + 'five cached automation expected' ); assert.equal( deployed['testInstance/testBU'].automation @@ -292,7 +301,7 @@ describe('type: automation', () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } }); const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [ - 'testExisting_automation_pause', + 'testExisting_automation_fixKey_schedule', 'testExisting_automation', ]); assert.equal( @@ -302,19 +311,28 @@ describe('type: automation', () => { ); assert.equal( resultFixKeys['testInstance/testBU'][0], - 'testExisting_automation_paused', + 'testExisting_automation_fixedKey_scheduled', 'returned keys do not correspond to expected fixed keys' ); // THEN assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error'); // confirm updated item assert.deepEqual( - await testUtils.getActualJson('testExisting_automation_paused', 'automation'), - await testUtils.getExpectedJson('9999999', 'automation', 'patch_fixKeys'), + await testUtils.getActualJson( + 'testExisting_automation_fixedKey_scheduled', + 'automation' + ), + await testUtils.getExpectedJson('9999999', 'automation', 'patch_fixKeys-schedule'), 'returned metadata was not equal expected for update automation' ); - expect(file(testUtils.getActualDoc('testExisting_automation_paused', 'automation'))).to - .exist; + expect( + file( + testUtils.getActualDoc( + 'testExisting_automation_fixedKey_scheduled', + 'automation' + ) + ) + ).to.exist; // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), @@ -327,7 +345,7 @@ describe('type: automation', () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, execute: true }); const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [ - 'testExisting_automation_pause', + 'testExisting_automation_fixKey_schedule', 'testExisting_automation', ]); assert.equal( @@ -337,19 +355,28 @@ describe('type: automation', () => { ); assert.equal( resultFixKeys['testInstance/testBU'][0], - 'testExisting_automation_paused', + 'testExisting_automation_fixedKey_scheduled', 'returned keys do not correspond to expected fixed keys' ); // THEN assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error'); // confirm updated item assert.deepEqual( - await testUtils.getActualJson('testExisting_automation_paused', 'automation'), - await testUtils.getExpectedJson('9999999', 'automation', 'patch_fixKeys'), + await testUtils.getActualJson( + 'testExisting_automation_fixedKey_scheduled', + 'automation' + ), + await testUtils.getExpectedJson('9999999', 'automation', 'patch_fixKeys-schedule'), 'returned metadata was not equal expected for update automation' ); - expect(file(testUtils.getActualDoc('testExisting_automation_paused', 'automation'))).to - .exist; + expect( + file( + testUtils.getActualDoc( + 'testExisting_automation_fixedKey_scheduled', + 'automation' + ) + ) + ).to.exist; // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), @@ -362,7 +389,7 @@ describe('type: automation', () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, schedule: true }); const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [ - 'testExisting_automation_pause', + 'testExisting_automation_fixKey_schedule', 'testExisting_automation', ]); assert.equal( @@ -372,19 +399,150 @@ describe('type: automation', () => { ); assert.equal( resultFixKeys['testInstance/testBU'][0], - 'testExisting_automation_paused', + 'testExisting_automation_fixedKey_scheduled', + 'returned keys do not correspond to expected fixed keys' + ); + // THEN + assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error'); + // confirm updated item + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_fixedKey_scheduled', + 'automation' + ), + await testUtils.getExpectedJson('9999999', 'automation', 'patch_fixKeys-schedule'), + 'returned metadata was not equal expected for update automation' + ); + expect( + file( + testUtils.getActualDoc( + 'testExisting_automation_fixedKey_scheduled', + 'automation' + ) + ) + ).to.exist; + // check number of API calls + assert.equal( + testUtils.getAPIHistoryLength(), + 32, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should fixKeys by key w/o re-retrieving, deploy paused', async () => { + // WHEN + handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } }); + const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [ + 'testExisting_automation_fixKey_pause', + ]); + assert.equal( + resultFixKeys['testInstance/testBU'].length, + 1, + 'returned number of keys does not correspond to number of expected fixed keys' + ); + assert.equal( + resultFixKeys['testInstance/testBU'][0], + 'testExisting_automation_fixedKey_paused', 'returned keys do not correspond to expected fixed keys' ); // THEN assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error'); // confirm updated item assert.deepEqual( - await testUtils.getActualJson('testExisting_automation_paused', 'automation'), - await testUtils.getExpectedJson('9999999', 'automation', 'patch_fixKeys'), + await testUtils.getActualJson( + 'testExisting_automation_fixedKey_paused', + 'automation' + ), + await testUtils.getExpectedJson('9999999', 'automation', 'patch_fixKeys-pause'), 'returned metadata was not equal expected for update automation' ); - expect(file(testUtils.getActualDoc('testExisting_automation_paused', 'automation'))).to - .exist; + expect( + file( + testUtils.getActualDoc('testExisting_automation_fixedKey_paused', 'automation') + ) + ).to.exist; + // check number of API calls + assert.equal( + testUtils.getAPIHistoryLength(), + 26, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should fixKeys by key w/o re-retrieving, deploy paused and then --execute', async () => { + // WHEN + handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, execute: true }); + const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [ + 'testExisting_automation_fixKey_pause', + 'testExisting_automation', + ]); + assert.equal( + resultFixKeys['testInstance/testBU'].length, + 1, + 'returned number of keys does not correspond to number of expected fixed keys' + ); + assert.equal( + resultFixKeys['testInstance/testBU'][0], + 'testExisting_automation_fixedKey_paused', + 'returned keys do not correspond to expected fixed keys' + ); + // THEN + assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error'); + // confirm updated item + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_fixedKey_paused', + 'automation' + ), + await testUtils.getExpectedJson('9999999', 'automation', 'patch_fixKeys-pause'), + 'returned metadata was not equal expected for update automation' + ); + expect( + file( + testUtils.getActualDoc('testExisting_automation_fixedKey_paused', 'automation') + ) + ).to.exist; + // check number of API calls + assert.equal( + testUtils.getAPIHistoryLength(), + 30, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should fixKeys by key w/o re-retrieving, deploy paused and then --schedule', async () => { + // WHEN + handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, schedule: true }); + const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [ + 'testExisting_automation_fixKey_pause', + 'testExisting_automation', + ]); + assert.equal( + resultFixKeys['testInstance/testBU'].length, + 1, + 'returned number of keys does not correspond to number of expected fixed keys' + ); + assert.equal( + resultFixKeys['testInstance/testBU'][0], + 'testExisting_automation_fixedKey_paused', + 'returned keys do not correspond to expected fixed keys' + ); + // THEN + assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error'); + // confirm updated item + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_fixedKey_paused', + 'automation' + ), + await testUtils.getExpectedJson('9999999', 'automation', 'patch_fixKeys-pause'), + 'returned metadata was not equal expected for update automation' + ); + expect( + file( + testUtils.getActualDoc('testExisting_automation_fixedKey_paused', 'automation') + ) + ).to.exist; // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), @@ -486,7 +644,7 @@ describe('type: automation', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 15, + 17, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; diff --git a/test/type.query.test.js b/test/type.query.test.js index 837678b71..c63420be7 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -458,7 +458,7 @@ describe('type: query', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 31, + 33, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -498,7 +498,7 @@ describe('type: query', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 33, + 35, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return;