Skip to content

Commit

Permalink
#1189: fixing test cases to deal with additional api request
Browse files Browse the repository at this point in the history
  • Loading branch information
JoernBerkefeld committed Jan 26, 2024
1 parent ff32087 commit d100576
Show file tree
Hide file tree
Showing 12 changed files with 180 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"dateFormatLocale": "en-US",
"deleteFile": false,
"description": "updated on deploy",
"encodingName": "utf-8",
"fieldMappingType": "InferFromColumnHeadings",
"fieldMappings": [],
"fileNamingPattern": "blabla",
Expand All @@ -21,9 +22,10 @@
"name": "testExisting_importFile",
"sendEmailNotification": false,
"standardQuotedStrings": true,
"r__fileLocation_name": "ExactTarget Enhanced FTP",
"c__blankFileProcessing": "Process",
"c__dataAction": "AddUpdate",
"c__destinationType": "DataExtension",
"r__dataExtension_CustomerKey": "testExisting_dataExtension",
"c__subscriberImportType": "DataExtension",
"c__dataAction": "AddUpdate"
"r__dataExtension_CustomerKey": "testExisting_dataExtension",
"r__fileLocation_name": "ExactTarget Enhanced FTP"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"allowErrors": true,
"customerKey": "testExisting_importFile",
"createdDate": "2022-11-09T05:32:30.533",
"modifiedDate": "2022-11-17T07:13:03.95",
"dateFormatLocale": "en-US",
"deleteFile": false,
"description": "17.11.2022",
"destinationObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7",
"destinationId": 0,
"destinationObjectTypeId": 310,
"destinationName": "testExisting_dataExtension",
"encodingName": "utf-8",
"fieldMappings": [],
"fieldMappingType": "InferFromColumnHeadings",
"fileNamingPattern": "blabla",
"fileTransferLocationId": "41a5ded7-0d98-4910-a15f-d09e7ab0af24",
"fileTransferLocationName": "ExactTarget Enhanced FTP",
"fileType": "CSV",
"filter": "",
"hasColumnHeader": true,
"importDefinitionId": "9d16f42c-2260-ed11-b849-48df37d1de8b",
"isOrderedImport": true,
"isSequential": true,
"maxFileAgeHours": 0,
"maxImportFrequencyHours": 0,
"maxFileAgeScheduleOffsetHours": 0,
"name": "testExisting_importFile",
"sendEmailNotification": false,
"standardQuotedStrings": true,
"subscriberImportTypeId": 255,
"updateTypeId": 0,
"fileTransferLocationTypeId": 0,
"blankFileProcessingType": 2
}
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
{
"allowErrors": true,
"customerKey": "testExisting_importFile",
"createdDate": "2022-11-09T05:32:30.533",
"modifiedDate": "2023-07-18T09:11:26.19",
"dateFormatLocale": "en-US",
"deleteFile": false,
"description": "updated on deploy",
"fieldMappingType": "InferFromColumnHeadings",
"destinationObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7",
"destinationId": 0,
"destinationObjectTypeId": 310,
"destinationName": "testExisting_dataExtension",
"encodingName": "utf-8",
"fieldMappings": [],
"fieldMappingType": "InferFromColumnHeadings",
"fileNamingPattern": "blabla",
"fileTransferLocationTypeId": 0,
"fileTransferLocationId": "41a5ded7-0d98-4910-a15f-d09e7ab0af24",
"fileTransferLocationName": "ExactTarget Enhanced FTP",
"fileType": "CSV",
"filter": "",
"hasColumnHeader": true,
"importDefinitionId": "9d16f42c-2260-ed11-b849-48df37d1de8b",
"isOrderedImport": true,
"isSequential": true,
"maxFileAgeHours": 0,
"maxFileAgeScheduleOffsetHours": 0,
"maxImportFrequencyHours": 0,
"maxFileAgeScheduleOffsetHours": 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"
"fileTransferLocationTypeId": 0,
"blankFileProcessingType": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<soap:Header>
<wsa:Action>RetrieveResponse</wsa:Action>
<wsa:MessageID>urn:uuid:58a4181c-9ea7-4d26-835b-f1eb50877b0b</wsa:MessageID>
<wsa:RelatesTo>urn:uuid:dab39bb4-2262-453a-9cb1-c591db9222d9</wsa:RelatesTo>
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-b8a68a2b-ad18-4ac0-8cea-dabe7d7d55c9">
<wsu:Created>2024-01-25T21:59:01Z</wsu:Created>
<wsu:Expires>2024-01-25T22:04:01Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
<OverallStatus>OK</OverallStatus>
<RequestID>fdc476c9-46dc-43f5-b8a6-57f2299c65ac</RequestID>
<Results xsi:type="ImportDefinition">
<PartnerKey xsi:nil="true" />
<ObjectID>9d16f42c-2260-ed11-b849-48df37d1de8b</ObjectID>
</Results>
</RetrieveResponseMsg>
</soap:Body>
</soap:Envelope>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<soap:Header>
<wsa:Action>RetrieveResponse</wsa:Action>
<wsa:MessageID>urn:uuid:58a4181c-9ea7-4d26-835b-f1eb50877b0b</wsa:MessageID>
<wsa:RelatesTo>urn:uuid:dab39bb4-2262-453a-9cb1-c591db9222d9</wsa:RelatesTo>
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-b8a68a2b-ad18-4ac0-8cea-dabe7d7d55c9">
<wsu:Created>2024-01-25T21:59:01Z</wsu:Created>
<wsu:Expires>2024-01-25T22:04:01Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
<OverallStatus>OK</OverallStatus>
<RequestID>fdc476c9-46dc-43f5-b8a6-57f2299c65ac</RequestID>
<Results xsi:type="ImportDefinition">
<PartnerKey xsi:nil="true" />
<ObjectID>9d16f42c-2260-ed11-b849-48df37d1de8b</ObjectID>
</Results>
</RetrieveResponseMsg>
</soap:Body>
</soap:Envelope>
4 changes: 3 additions & 1 deletion test/resources/9999999/importFile/build-expected.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"allowErrors": true,
"c__blankFileProcessing": "Skip",
"c__dataAction": "AddUpdate",
"c__destinationType": "DataExtension",
"c__subscriberImportType": "DataExtension",
"customerKey": "testTemplated_importFile",
"dateFormatLocale": "en-US",
"deleteFile": false,
"description": "17.11.2022",
"fieldMappingType": "InferFromColumnHeadings",
"encodingName": "utf-8",
"fieldMappings": [],
"fieldMappingType": "InferFromColumnHeadings",
"fileNamingPattern": "blabla",
"fileTransferLocationTypeId": 0,
"fileType": "CSV",
Expand Down
16 changes: 9 additions & 7 deletions test/resources/9999999/importFile/get-expected.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{
"allowErrors": true,
"c__blankFileProcessing": "Skip",
"c__dataAction": "AddUpdate",
"c__destinationType": "DataExtension",
"c__subscriberImportType": "DataExtension",
"createdDate": "2022-11-09T05:32:30.533",
"customerKey": "testExisting_importFile",
"dateFormatLocale": "en-US",
"deleteFile": false,
"description": "17.11.2022",
"fieldMappingType": "InferFromColumnHeadings",
"encodingName": "utf-8",
"fieldMappings": [],
"fieldMappingType": "InferFromColumnHeadings",
"fileNamingPattern": "blabla",
"fileTransferLocationTypeId": 0,
"fileType": "CSV",
Expand All @@ -19,11 +24,8 @@
"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"
"r__fileLocation_name": "ExactTarget Enhanced FTP",
"sendEmailNotification": false,
"standardQuotedStrings": true
}
6 changes: 4 additions & 2 deletions test/resources/9999999/importFile/patch-expected.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"allowErrors": true,
"c__blankFileProcessing": "Process",
"c__dataAction": "AddUpdate",
"c__destinationType": "DataExtension",
"c__subscriberImportType": "DataExtension",
"createdDate": "2022-11-09T05:53:03.243",
"createdDate": "2022-11-09T05:32:30.533",
"customerKey": "testExisting_importFile",
"dateFormatLocale": "en-US",
"deleteFile": false,
"description": "updated on deploy",
"fieldMappingType": "InferFromColumnHeadings",
"encodingName": "utf-8",
"fieldMappings": [],
"fieldMappingType": "InferFromColumnHeadings",
"fileNamingPattern": "blabla",
"fileTransferLocationTypeId": 0,
"fileType": "CSV",
Expand Down
2 changes: 2 additions & 0 deletions test/resources/9999999/importFile/template-expected.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"allowErrors": true,
"c__blankFileProcessing": "Skip",
"c__dataAction": "AddUpdate",
"c__destinationType": "DataExtension",
"c__subscriberImportType": "DataExtension",
"customerKey": "{{{prefix}}}importFile",
"dateFormatLocale": "en-US",
"deleteFile": false,
"description": "17.11.2022",
"encodingName": "utf-8",
"fieldMappingType": "InferFromColumnHeadings",
"fieldMappings": [],
"fileNamingPattern": "blabla",
Expand Down
26 changes: 13 additions & 13 deletions test/type.automation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('type: automation', () => {
);
assert.equal(
testUtils.getAPIHistoryLength(),
18,
19,
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
);
return;
Expand Down Expand Up @@ -119,7 +119,7 @@ describe('type: automation', () => {

assert.equal(
testUtils.getAPIHistoryLength(),
25,
26,
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
);
return;
Expand Down Expand Up @@ -188,7 +188,7 @@ describe('type: automation', () => {

assert.equal(
testUtils.getAPIHistoryLength(),
33,
34,
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
);
return;
Expand Down Expand Up @@ -256,7 +256,7 @@ describe('type: automation', () => {

assert.equal(
testUtils.getAPIHistoryLength(),
29,
30,
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
);
return;
Expand Down Expand Up @@ -291,7 +291,7 @@ describe('type: automation', () => {
// check number of API calls
assert.equal(
testUtils.getAPIHistoryLength(),
18,
19,
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
);
return;
Expand Down Expand Up @@ -335,7 +335,7 @@ describe('type: automation', () => {
// check number of API calls
assert.equal(
testUtils.getAPIHistoryLength(),
40,
42,
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
);
return;
Expand Down Expand Up @@ -379,7 +379,7 @@ describe('type: automation', () => {
// check number of API calls
assert.equal(
testUtils.getAPIHistoryLength(),
42,
44,
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
);
return;
Expand Down Expand Up @@ -423,7 +423,7 @@ describe('type: automation', () => {
// check number of API calls
assert.equal(
testUtils.getAPIHistoryLength(),
43,
45,
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
);
return;
Expand Down Expand Up @@ -463,7 +463,7 @@ describe('type: automation', () => {
// check number of API calls
assert.equal(
testUtils.getAPIHistoryLength(),
35,
37,
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
);
return;
Expand Down Expand Up @@ -504,7 +504,7 @@ describe('type: automation', () => {
// check number of API calls
assert.equal(
testUtils.getAPIHistoryLength(),
41,
43,
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
);
return;
Expand Down Expand Up @@ -545,7 +545,7 @@ describe('type: automation', () => {
// check number of API calls
assert.equal(
testUtils.getAPIHistoryLength(),
43,
45,
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
);
return;
Expand Down Expand Up @@ -596,7 +596,7 @@ describe('type: automation', () => {
);
assert.equal(
testUtils.getAPIHistoryLength(),
20,
21,
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
);
return;
Expand Down Expand Up @@ -643,7 +643,7 @@ describe('type: automation', () => {
);
assert.equal(
testUtils.getAPIHistoryLength(),
18,
19,
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
);
return;
Expand Down
Loading

0 comments on commit d100576

Please sign in to comment.