Skip to content

Commit

Permalink
Merge pull request #1011 from Accenture/task/1010-ensure-test-load-mo…
Browse files Browse the repository at this point in the history
…re-specific-soap-response-files

Task/1010 ensure test load more specific soap response files
  • Loading branch information
JoernBerkefeld authored Jun 30, 2023
2 parents 827dec4 + 22de4fa commit 0cfc978
Show file tree
Hide file tree
Showing 20 changed files with 797 additions and 17 deletions.
7 changes: 3 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"env": {
"es6": true,
"node": true,
"mocha": true
"node": true
},
"extends": [
"eslint:recommended",
Expand Down Expand Up @@ -67,7 +66,6 @@
"unicorn/prefer-set-has": "off",
"unicorn/prefer-spread": "off",
"unicorn/prefer-string-replace-all": "error",
"unicorn/unicorn/no-lonely-if": "off",
"arrow-body-style": ["error", "as-needed"],
"curly": "error",
"no-console": "error",
Expand Down Expand Up @@ -104,7 +102,8 @@
"extends": ["plugin:mocha/recommended"],
"plugins": ["mocha"],
"rules": {
"mocha/no-mocha-arrows": "off"
"mocha/no-mocha-arrows": "off",
"mocha/no-pending-tests": "off"
}
}
]
Expand Down
8 changes: 6 additions & 2 deletions test/resourceFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,18 @@ exports.filterToPath = (filter) => {
return '';
};
exports._filterToPath = (filter) => {
if (filter.Property && filter.SimpleOperator && filter.Value) {
return `${filter.Property}${filter.SimpleOperator.replace('equals', '=')}${filter.Value}`;
if (filter.Property && filter.SimpleOperator) {
return `${filter.Property}${filter.SimpleOperator.replace('equals', '=')}${
filter.Value === undefined ? '' : filter.Value
}`;
} else if (filter.LeftOperand && filter.LogicalOperator && filter.RightOperand) {
return (
this._filterToPath(filter.LeftOperand) +
filter.LogicalOperator +
this._filterToPath(filter.RightOperand)
);
} else {
throw new Error('unknown filter type');
}
};
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
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"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header>
<wsa:Action>RetrieveResponse</wsa:Action>
<wsa:MessageID>urn:uuid:1babdae0-9282-4bba-b69f-2f1843deaf11</wsa:MessageID>
<wsa:RelatesTo>urn:uuid:39d1c021-b3df-49f9-a8f7-bb444172d2d3</wsa:RelatesTo>
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-291db2ee-625d-49f7-8f6f-110317b081a5">
<wsu:Created>2023-03-11T13:53:00Z</wsu:Created>
<wsu:Expires>2023-03-11T13:58:00Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
<OverallStatus>OK</OverallStatus>
<RequestID>5347bf1d-e801-486a-b4a9-c2d46a8909b6</RequestID>

</RetrieveResponseMsg>
</soap:Body>
</soap:Envelope>
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
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"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header>
<wsa:Action>RetrieveResponse</wsa:Action>
<wsa:MessageID>urn:uuid:1babdae0-9282-4bba-b69f-2f1843deaf11</wsa:MessageID>
<wsa:RelatesTo>urn:uuid:39d1c021-b3df-49f9-a8f7-bb444172d2d3</wsa:RelatesTo>
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-291db2ee-625d-49f7-8f6f-110317b081a5">
<wsu:Created>2023-03-11T13:53:00Z</wsu:Created>
<wsu:Expires>2023-03-11T13:58:00Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
<OverallStatus>OK</OverallStatus>
<RequestID>5347bf1d-e801-486a-b4a9-c2d46a8909b6</RequestID>
<Results xsi:type="AccountUser">
<Client>
<ID>1111111</ID>
<ModifiedBy>123456</ModifiedBy>
</Client>
<PartnerKey xsi:nil="true" />
<CreatedDate>2019-09-06T01:59:07.097</CreatedDate>
<ModifiedDate>2022-06-21T01:43:02.64</ModifiedDate>
<ID>700301951</ID>
<ObjectID xsi:nil="true" />
<CustomerKey>testExisting_user_inactive</CustomerKey>
<AccountUserID>700301951</AccountUserID>
<UserID>user_test-inactive@accenture.asgr</UserID>
<Name>user test-inactive</Name>
<Email>user_test-inactive@accenture.com</Email>
<MustChangePassword>false</MustChangePassword>
<ActiveFlag>false</ActiveFlag>
<UserPermissions>
<PartnerKey xsi:nil="true" />
<ID>2</ID>
<ObjectID xsi:nil="true" />
<Name xsi:nil="true" />
<Value xsi:nil="true" />
<Description xsi:nil="true" />
<Delete>0</Delete>
</UserPermissions>
<UserPermissions>
<PartnerKey xsi:nil="true" />
<ID>3</ID>
<ObjectID xsi:nil="true" />
<Name xsi:nil="true" />
<Value xsi:nil="true" />
<Description xsi:nil="true" />
<Delete>0</Delete>
</UserPermissions>
<Delete>0</Delete>
<LastSuccessfulLogin>2023-02-23T10:14:11.443</LastSuccessfulLogin>
<IsAPIUser>false</IsAPIUser>
<NotificationEmailAddress>user_test-inactive@accenture.com</NotificationEmailAddress>
<IsLocked>false</IsLocked>
<DefaultBusinessUnit>1111111</DefaultBusinessUnit>
<DefaultBusinessUnitObject>
<PartnerKey xsi:nil="true" />
<ID>1111111</ID>
<ObjectID xsi:nil="true" />
<AccountType>None</AccountType>
<Subscription xsi:nil="true" />
</DefaultBusinessUnitObject>
<Locale>
<PartnerKey xsi:nil="true" />
<ObjectID xsi:nil="true" />
<LocaleCode>en-GB</LocaleCode>
</Locale>
<TimeZone>
<PartnerKey xsi:nil="true" />
<ID>5</ID>
<ObjectID xsi:nil="true" />
<Name>(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna *</Name>
</TimeZone>
<Roles>
<Role>
<Client>
<ID>1111111</ID>
<CreatedBy>-1000</CreatedBy>
<ModifiedBy>-1000</ModifiedBy>
<EnterpriseID>1111111</EnterpriseID>
</Client>
<PartnerKey xsi:nil="true" />
<CreatedDate>2016-07-22T17:52:36.93</CreatedDate>
<ModifiedDate>2016-07-22T17:52:36.93</ModifiedDate>
<ObjectID>f1cfb80f-3550-e611-96fe-38eaa7142c61</ObjectID>
<CustomerKey>SYS_DEF_ADMIN</CustomerKey>
<Name>Administrator</Name>
<Description>Administrator</Description>
<IsPrivate>false</IsPrivate>
<IsSystemDefined>true</IsSystemDefined>
</Role>
<Role>
<Client>
<ID>1111111</ID>
<CreatedBy>-1000</CreatedBy>
<ModifiedBy>-1000</ModifiedBy>
<EnterpriseID>1111111</EnterpriseID>
</Client>
<PartnerKey xsi:nil="true" />
<CreatedDate>2016-07-22T17:52:36.93</CreatedDate>
<ModifiedDate>2016-07-22T17:52:36.93</ModifiedDate>
<ObjectID>f4cfb80f-3550-e611-96fe-38eaa7142c61</ObjectID>
<CustomerKey>SYS_DEF_CONTENT</CustomerKey>
<Name>Content Creator</Name>
<Description>Content Creator</Description>
<IsPrivate>false</IsPrivate>
<IsSystemDefined>true</IsSystemDefined>
</Role>
<Role>
<Client>
<ID>1111111</ID>
<CreatedBy>-1000</CreatedBy>
<ModifiedBy>-1000</ModifiedBy>
<EnterpriseID>1111111</EnterpriseID>
</Client>
<PartnerKey xsi:nil="true" />
<CreatedDate>2019-09-06T07:59:07.8</CreatedDate>
<ModifiedDate>2019-09-06T07:59:07.8</ModifiedDate>
<ObjectID>bd251431-7cd0-e911-a2d3-1402ec936979</ObjectID>
<CustomerKey>Individual role for 700301951</CustomerKey>
<Name>Individual role for 700301951</Name>
<Description>Individual role for 700301951</Description>
<IsPrivate>true</IsPrivate>
<IsSystemDefined>false</IsSystemDefined>
</Role>
<Role>
<Client>
<ID>0</ID>
<CreatedBy>0</CreatedBy>
<ModifiedBy>0</ModifiedBy>
<EnterpriseID>0</EnterpriseID>
</Client>
<PartnerKey xsi:nil="true" />
<CreatedDate>2012-02-21T02:09:19.983</CreatedDate>
<ModifiedDate>2013-12-23T16:48:50.533</ModifiedDate>
<ObjectID>63a50610-315c-e111-beee-8e001800001f</ObjectID>
<CustomerKey>SYS_DEF_IMHADMIN</CustomerKey>
<Name>Marketing Cloud Administrator</Name>
<Description>Assign Marketing Cloud roles to users and manage Mobile, Social and Sites Channels, Hub Apps and Marketing Cloud Tools</Description>
<IsPrivate>false</IsPrivate>
<IsSystemDefined>true</IsSystemDefined>
</Role>
</Roles>
</Results>
</RetrieveResponseMsg>
</soap:Body>
</soap:Envelope>
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
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"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header>
<wsa:Action>RetrieveResponse</wsa:Action>
<wsa:MessageID>urn:uuid:1babdae0-9282-4bba-b69f-2f1843deaf11</wsa:MessageID>
<wsa:RelatesTo>urn:uuid:39d1c021-b3df-49f9-a8f7-bb444172d2d3</wsa:RelatesTo>
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-291db2ee-625d-49f7-8f6f-110317b081a5">
<wsu:Created>2023-03-11T13:53:00Z</wsu:Created>
<wsu:Expires>2023-03-11T13:58:00Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
<OverallStatus>OK</OverallStatus>
<RequestID>5347bf1d-e801-486a-b4a9-c2d46a8909b6</RequestID>
<Results xsi:type="AccountUser">
<Client>
<ID>1111111</ID>
<ModifiedBy>0</ModifiedBy>
</Client>
<PartnerKey xsi:nil="true" />
<CreatedDate>2016-07-22T11:52:37.42</CreatedDate>
<ModifiedDate>2023-05-27T07:05:55.113</ModifiedDate>
<ID>7471228</ID>
<ObjectID xsi:nil="true" />
<CustomerKey>45372cbb-06e0-438e-88d8-008981f7a18b</CustomerKey>
<AccountUserID>7471228</AccountUserID>
<UserID>20f2d94a-9a7d-4580-9fb6-c36a1ce32fb9</UserID>
<Name>igopredictiveemail app user</Name>
<Email />
<MustChangePassword>false</MustChangePassword>
<ActiveFlag>true</ActiveFlag>
<Delete>0</Delete>
<LastSuccessfulLogin></LastSuccessfulLogin>
<IsAPIUser>true</IsAPIUser>
<NotificationEmailAddress />
<IsLocked>false</IsLocked>
<DefaultBusinessUnit>1111111</DefaultBusinessUnit>
<Locale>
<PartnerKey xsi:nil="true" />
<ObjectID xsi:nil="true" />
<LocaleCode>en-GB</LocaleCode>
</Locale>
<TimeZone>
<PartnerKey xsi:nil="true" />
<ID>5</ID>
<ObjectID xsi:nil="true" />
<Name>(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna</Name>
</TimeZone>
<DefaultBusinessUnitObject>
<PartnerKey xsi:nil="true" />
<ID>1111111</ID>
<ObjectID xsi:nil="true" />
<AccountType>None</AccountType>
<Subscription xsi:nil="true" />
</DefaultBusinessUnitObject>
<Roles>
<Role>
<Client>
<ID>1111111</ID>
<CreatedBy>0</CreatedBy>
<ModifiedBy>0</ModifiedBy>
<EnterpriseID>1111111</EnterpriseID>
</Client>
<PartnerKey xsi:nil="true" />
<CreatedDate>2016-07-22T17:52:37.88</CreatedDate>
<ModifiedDate>2016-07-22T17:52:37.88</ModifiedDate>
<ObjectID>44d0b80f-3550-e611-96fe-38eaa7142c61</ObjectID>
<CustomerKey>Individual role for 7471228</CustomerKey>
<Name>Individual role for 7471228</Name>
<Description>Individual role for 7471228</Description>
<IsPrivate>true</IsPrivate>
<IsSystemDefined>false</IsSystemDefined>
</Role>
</Roles>
</Results>
</RetrieveResponseMsg>
</soap:Body>
</soap:Envelope>
Loading

0 comments on commit 0cfc978

Please sign in to comment.