Skip to content

Commit

Permalink
#852: add test class for type importFile
Browse files Browse the repository at this point in the history
  • Loading branch information
JoernBerkefeld committed Jul 18, 2023
1 parent 9bc583c commit 8008444
Show file tree
Hide file tree
Showing 12 changed files with 484 additions and 7 deletions.
42 changes: 36 additions & 6 deletions lib/metadataTypes/definitions/ImportFile.definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,41 @@ module.exports = {
retrieving: true,
template: true,
},
c__dataAction: { skipValidation: true },
r__dataExtension_CustomerKey: { skipValidation: true },
c__destinationType: { skipValidation: true },
r__list_PathName: { skipValidation: true },
r__fileLocation_name: { skipValidation: true },
c__subscriberImportType: { skipValidation: true },
c__dataAction: {
isCreateable: false,
isUpdateable: false,
retrieving: true,
template: true,
},
r__dataExtension_CustomerKey: {
isCreateable: false,
isUpdateable: false,
retrieving: true,
template: true,
},
c__destinationType: {
isCreateable: false,
isUpdateable: false,
retrieving: true,
template: true,
},
r__list_PathName: {
isCreateable: false,
isUpdateable: false,
retrieving: true,
template: true,
},
r__fileLocation_name: {
isCreateable: false,
isUpdateable: false,
retrieving: true,
template: true,
},
c__subscriberImportType: {
isCreateable: false,
isUpdateable: false,
retrieving: true,
template: true,
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"allowErrors": true,
"createdDate": "2022-11-09T05:32:30.533",
"customerKey": "testExisting_importFile",
"dateFormatLocale": "en-US",
"deleteFile": false,
"description": "updated on deploy",
"fieldMappingType": "InferFromColumnHeadings",
"fieldMappings": [],
"fileNamingPattern": "blabla",
"fileTransferLocationTypeId": 0,
"fileType": "CSV",
"filter": "",
"hasColumnHeader": true,
"isOrderedImport": true,
"isSequential": true,
"maxFileAgeHours": 0,
"maxFileAgeScheduleOffsetHours": 0,
"maxImportFrequencyHours": 0,
"modifiedDate": "2022-11-17T07:13:03.95",
"name": "testExisting_importFile",
"sendEmailNotification": false,
"standardQuotedStrings": true,
"r__fileLocation_name": "ExactTarget Enhanced FTP",
"c__destinationType": "DataExtension",
"r__dataExtension_CustomerKey": "testExisting_dataExtension",
"c__subscriberImportType": "DataExtension",
"c__dataAction": "AddUpdate"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"allowErrors": true,
"createdDate": "2022-11-09T05:32:30.533",
"customerKey": "testNew_importFile",
"dateFormatLocale": "en-US",
"deleteFile": false,
"description": "created via deploy",
"fieldMappingType": "InferFromColumnHeadings",
"fieldMappings": [],
"fileNamingPattern": "blabla",
"fileTransferLocationTypeId": 0,
"fileType": "CSV",
"filter": "",
"hasColumnHeader": true,
"isOrderedImport": true,
"isSequential": true,
"maxFileAgeHours": 0,
"maxFileAgeScheduleOffsetHours": 0,
"maxImportFrequencyHours": 0,
"modifiedDate": "2022-11-17T07:13:03.95",
"name": "testNew_importFile",
"sendEmailNotification": false,
"standardQuotedStrings": true,
"r__fileLocation_name": "ExactTarget Enhanced FTP",
"c__destinationType": "DataExtension",
"r__dataExtension_CustomerKey": "testExisting_dataExtension",
"c__subscriberImportType": "DataExtension",
"c__dataAction": "AddUpdate"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"allowErrors": true,
"customerKey": "testExisting_importFile",
"dateFormatLocale": "en-US",
"deleteFile": false,
"description": "updated on deploy",
"fieldMappingType": "InferFromColumnHeadings",
"fieldMappings": [],
"fileNamingPattern": "blabla",
"fileTransferLocationTypeId": 0,
"fileType": "CSV",
"filter": "",
"hasColumnHeader": true,
"isOrderedImport": true,
"isSequential": true,
"maxFileAgeHours": 0,
"maxFileAgeScheduleOffsetHours": 0,
"maxImportFrequencyHours": 0,
"name": "testExisting_importFile",
"sendEmailNotification": false,
"standardQuotedStrings": true,
"fileTransferLocationId": "41a5ded7-0d98-4910-a15f-d09e7ab0af24",
"destinationObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7",
"destinationObjectTypeId": 310,
"subscriberImportTypeId": 255,
"updateTypeId": 0,
"importDefinitionId": "9d16f42c-2260-ed11-b849-48df37d1de8b",
"createdDate": "2022-11-09T05:53:03.243",
"destinationId": 0,
"modifiedDate": "2023-07-18T09:11:26.19"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dateFormatLocale": "en-US",
"deleteFile": false,
"description": "17.11.2022",
"destinationObjectId": "bf457cfa-ca04-ec11-b82d-48df37d1da95",
"destinationObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7",
"destinationId": 0,
"destinationObjectTypeId": 310,
"fieldMappings": [],
Expand Down
30 changes: 30 additions & 0 deletions test/resources/9999999/automation/v1/imports/post-response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"allowErrors": true,
"customerKey": "testNew_importFile",
"dateFormatLocale": "en-US",
"deleteFile": false,
"description": "created via deploy",
"fieldMappingType": "InferFromColumnHeadings",
"fieldMappings": [],
"fileNamingPattern": "blabla",
"fileTransferLocationTypeId": 0,
"fileType": "CSV",
"filter": "",
"hasColumnHeader": true,
"isOrderedImport": true,
"isSequential": true,
"maxFileAgeHours": 0,
"maxFileAgeScheduleOffsetHours": 0,
"maxImportFrequencyHours": 0,
"name": "testNew_importFile",
"sendEmailNotification": false,
"standardQuotedStrings": true,
"fileTransferLocationId": "41a5ded7-0d98-4910-a15f-d09e7ab0af24",
"destinationObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7",
"destinationObjectTypeId": 310,
"subscriberImportTypeId": 255,
"updateTypeId": 0,
"createdDate": "2022-11-09T05:53:03.243",
"destinationId": 0,
"modifiedDate": "2023-07-18T09:11:26.19"
}
27 changes: 27 additions & 0 deletions test/resources/9999999/importFile/build-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"allowErrors": true,
"c__dataAction": "AddUpdate",
"c__destinationType": "DataExtension",
"c__subscriberImportType": "DataExtension",
"customerKey": "testTemplated_importFile",
"dateFormatLocale": "en-US",
"deleteFile": false,
"description": "17.11.2022",
"fieldMappingType": "InferFromColumnHeadings",
"fieldMappings": [],
"fileNamingPattern": "blabla",
"fileTransferLocationTypeId": 0,
"fileType": "CSV",
"filter": "",
"hasColumnHeader": true,
"isOrderedImport": true,
"isSequential": true,
"maxFileAgeHours": 0,
"maxFileAgeScheduleOffsetHours": 0,
"maxImportFrequencyHours": 0,
"name": "testTemplated_importFile",
"r__dataExtension_CustomerKey": "testTemplated_dataExtension",
"r__fileLocation_name": "ExactTarget Enhanced FTP",
"sendEmailNotification": false,
"standardQuotedStrings": true
}
29 changes: 29 additions & 0 deletions test/resources/9999999/importFile/get-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"allowErrors": true,
"createdDate": "2022-11-09T05:32:30.533",
"customerKey": "testExisting_importFile",
"dateFormatLocale": "en-US",
"deleteFile": false,
"description": "17.11.2022",
"fieldMappingType": "InferFromColumnHeadings",
"fieldMappings": [],
"fileNamingPattern": "blabla",
"fileTransferLocationTypeId": 0,
"fileType": "CSV",
"filter": "",
"hasColumnHeader": true,
"isOrderedImport": true,
"isSequential": true,
"maxFileAgeHours": 0,
"maxFileAgeScheduleOffsetHours": 0,
"maxImportFrequencyHours": 0,
"modifiedDate": "2022-11-17T07:13:03.95",
"name": "testExisting_importFile",
"sendEmailNotification": false,
"standardQuotedStrings": true,
"c__dataAction": "AddUpdate",
"c__destinationType": "DataExtension",
"c__subscriberImportType": "DataExtension",
"r__dataExtension_CustomerKey": "testExisting_dataExtension",
"r__fileLocation_name": "ExactTarget Enhanced FTP"
}
29 changes: 29 additions & 0 deletions test/resources/9999999/importFile/patch-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"allowErrors": true,
"c__dataAction": "AddUpdate",
"c__destinationType": "DataExtension",
"c__subscriberImportType": "DataExtension",
"createdDate": "2022-11-09T05:53:03.243",
"customerKey": "testExisting_importFile",
"dateFormatLocale": "en-US",
"deleteFile": false,
"description": "updated on deploy",
"fieldMappingType": "InferFromColumnHeadings",
"fieldMappings": [],
"fileNamingPattern": "blabla",
"fileTransferLocationTypeId": 0,
"fileType": "CSV",
"filter": "",
"hasColumnHeader": true,
"isOrderedImport": true,
"isSequential": true,
"maxFileAgeHours": 0,
"maxFileAgeScheduleOffsetHours": 0,
"maxImportFrequencyHours": 0,
"modifiedDate": "2023-07-18T09:11:26.19",
"name": "testExisting_importFile",
"r__dataExtension_CustomerKey": "testExisting_dataExtension",
"r__fileLocation_name": "ExactTarget Enhanced FTP",
"sendEmailNotification": false,
"standardQuotedStrings": true
}
29 changes: 29 additions & 0 deletions test/resources/9999999/importFile/post-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"allowErrors": true,
"c__dataAction": "AddUpdate",
"c__destinationType": "DataExtension",
"c__subscriberImportType": "DataExtension",
"createdDate": "2022-11-09T05:53:03.243",
"customerKey": "testNew_importFile",
"dateFormatLocale": "en-US",
"deleteFile": false,
"description": "created via deploy",
"fieldMappingType": "InferFromColumnHeadings",
"fieldMappings": [],
"fileNamingPattern": "blabla",
"fileTransferLocationTypeId": 0,
"fileType": "CSV",
"filter": "",
"hasColumnHeader": true,
"isOrderedImport": true,
"isSequential": true,
"maxFileAgeHours": 0,
"maxFileAgeScheduleOffsetHours": 0,
"maxImportFrequencyHours": 0,
"modifiedDate": "2023-07-18T09:11:26.19",
"name": "testNew_importFile",
"r__dataExtension_CustomerKey": "testExisting_dataExtension",
"r__fileLocation_name": "ExactTarget Enhanced FTP",
"sendEmailNotification": false,
"standardQuotedStrings": true
}
27 changes: 27 additions & 0 deletions test/resources/9999999/importFile/template-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"allowErrors": true,
"c__dataAction": "AddUpdate",
"c__destinationType": "DataExtension",
"c__subscriberImportType": "DataExtension",
"customerKey": "{{{prefix}}}importFile",
"dateFormatLocale": "en-US",
"deleteFile": false,
"description": "17.11.2022",
"fieldMappingType": "InferFromColumnHeadings",
"fieldMappings": [],
"fileNamingPattern": "blabla",
"fileTransferLocationTypeId": 0,
"fileType": "CSV",
"filter": "",
"hasColumnHeader": true,
"isOrderedImport": true,
"isSequential": true,
"maxFileAgeHours": 0,
"maxFileAgeScheduleOffsetHours": 0,
"maxImportFrequencyHours": 0,
"name": "{{{prefix}}}importFile",
"r__dataExtension_CustomerKey": "{{{prefix}}}dataExtension",
"r__fileLocation_name": "ExactTarget Enhanced FTP",
"sendEmailNotification": false,
"standardQuotedStrings": true
}
Loading

0 comments on commit 8008444

Please sign in to comment.