@itentialopensource/adapter-godaddy 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/.eslintignore +5 -0
  2. package/.eslintrc.js +18 -0
  3. package/.gitlab/.gitkeep +0 -0
  4. package/.gitlab/issue_templates/.gitkeep +0 -0
  5. package/.gitlab/issue_templates/Default.md +17 -0
  6. package/.gitlab/issue_templates/bugReportTemplate.md +76 -0
  7. package/.gitlab/issue_templates/featureRequestTemplate.md +14 -0
  8. package/.jshintrc +3 -0
  9. package/AUTH.md +34 -0
  10. package/BROKER.md +199 -0
  11. package/CALLS.md +748 -0
  12. package/CHANGELOG.md +9 -0
  13. package/CODE_OF_CONDUCT.md +43 -0
  14. package/CONTRIBUTING.md +13 -0
  15. package/ENHANCE.md +69 -0
  16. package/LICENSE +201 -0
  17. package/PROPERTIES.md +641 -0
  18. package/README.md +346 -0
  19. package/SUMMARY.md +9 -0
  20. package/SYSTEMINFO.md +13 -0
  21. package/TROUBLESHOOT.md +47 -0
  22. package/adapter.js +9144 -0
  23. package/adapterBase.js +1452 -0
  24. package/changelogs/CHANGELOG.md +0 -0
  25. package/entities/.generic/action.json +214 -0
  26. package/entities/.generic/schema.json +28 -0
  27. package/entities/.system/action.json +50 -0
  28. package/entities/.system/mockdatafiles/getToken-default.json +3 -0
  29. package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
  30. package/entities/.system/schema.json +19 -0
  31. package/entities/.system/schemaTokenReq.json +53 -0
  32. package/entities/.system/schemaTokenResp.json +53 -0
  33. package/entities/Abuse/action.json +66 -0
  34. package/entities/Abuse/schema.json +21 -0
  35. package/entities/Actions/action.json +66 -0
  36. package/entities/Actions/mockdatafiles/getV2CustomersCustomerIdDomainsDomainActions-default.json +126 -0
  37. package/entities/Actions/schema.json +21 -0
  38. package/entities/Aftermarket/action.json +44 -0
  39. package/entities/Aftermarket/schema.json +20 -0
  40. package/entities/Agreements/action.json +25 -0
  41. package/entities/Agreements/mockdatafiles/getAgreements-default.json +8 -0
  42. package/entities/Agreements/schema.json +19 -0
  43. package/entities/Certificate/action.json +517 -0
  44. package/entities/Certificate/mockdatafiles/certificateGetEntitlement-default.json +205 -0
  45. package/entities/Certificate/mockdatafiles/getDomainInformationByCertificateId-default.json +32 -0
  46. package/entities/Certificate/schema.json +43 -0
  47. package/entities/Countries/action.json +46 -0
  48. package/entities/Countries/schema.json +20 -0
  49. package/entities/Domains/action.json +696 -0
  50. package/entities/Domains/mockdatafiles/domainsForwardsGet-default.json +12 -0
  51. package/entities/Domains/mockdatafiles/getAgreement-default.json +8 -0
  52. package/entities/Domains/mockdatafiles/listDomains-default.json +198 -0
  53. package/entities/Domains/mockdatafiles/recordGet-default.json +24 -0
  54. package/entities/Domains/mockdatafiles/suggest-default.json +11 -0
  55. package/entities/Domains/mockdatafiles/tlds-default.json +14 -0
  56. package/entities/Domains/schema.json +52 -0
  57. package/entities/Notifications/action.json +107 -0
  58. package/entities/Notifications/mockdatafiles/getV2CustomersCustomerIdDomainsNotificationsOptIn-default.json +32 -0
  59. package/entities/Notifications/schema.json +23 -0
  60. package/entities/Orders/action.json +46 -0
  61. package/entities/Orders/schema.json +20 -0
  62. package/entities/Parking/action.json +46 -0
  63. package/entities/Parking/schema.json +20 -0
  64. package/entities/Shoppers/action.json +126 -0
  65. package/entities/Shoppers/schema.json +24 -0
  66. package/entities/Subscriptions/action.json +107 -0
  67. package/entities/Subscriptions/mockdatafiles/productGroups-default.json +10 -0
  68. package/entities/Subscriptions/schema.json +23 -0
  69. package/error.json +190 -0
  70. package/metadata.json +54 -0
  71. package/package.json +82 -0
  72. package/pronghorn.json +15805 -0
  73. package/propertiesDecorators.json +14 -0
  74. package/propertiesSchema.json +1661 -0
  75. package/refs?service=git-upload-pack +0 -0
  76. package/report/adapter-openapi.json +13714 -0
  77. package/report/adapter-openapi.yaml +20419 -0
  78. package/report/adapterInfo.json +10 -0
  79. package/report/creationReport.json +765 -0
  80. package/report/godaddy.json +13714 -0
  81. package/report/updateReport1706477552013.json +120 -0
  82. package/sampleProperties.json +254 -0
  83. package/test/integration/adapterTestBasicGet.js +83 -0
  84. package/test/integration/adapterTestConnectivity.js +142 -0
  85. package/test/integration/adapterTestIntegration.js +2925 -0
  86. package/test/unit/adapterBaseTestUnit.js +1024 -0
  87. package/test/unit/adapterTestUnit.js +4900 -0
  88. package/utils/adapterInfo.js +206 -0
  89. package/utils/addAuth.js +94 -0
  90. package/utils/artifactize.js +146 -0
  91. package/utils/basicGet.js +50 -0
  92. package/utils/checkMigrate.js +63 -0
  93. package/utils/entitiesToDB.js +179 -0
  94. package/utils/findPath.js +74 -0
  95. package/utils/methodDocumentor.js +273 -0
  96. package/utils/modify.js +152 -0
  97. package/utils/packModificationScript.js +35 -0
  98. package/utils/patches2bundledDeps.js +90 -0
  99. package/utils/pre-commit.sh +32 -0
  100. package/utils/removeHooks.js +20 -0
  101. package/utils/setup.js +33 -0
  102. package/utils/taskMover.js +309 -0
  103. package/utils/tbScript.js +239 -0
  104. package/utils/tbUtils.js +489 -0
  105. package/utils/testRunner.js +298 -0
  106. package/utils/troubleshootingAdapter.js +193 -0
@@ -0,0 +1,2925 @@
1
+ /* @copyright Itential, LLC 2019 (pre-modifications) */
2
+
3
+ // Set globals
4
+ /* global describe it log pronghornProps */
5
+ /* eslint no-unused-vars: warn */
6
+ /* eslint no-underscore-dangle: warn */
7
+ /* eslint import/no-dynamic-require:warn */
8
+
9
+ // include required items for testing & logging
10
+ const assert = require('assert');
11
+ const fs = require('fs');
12
+ const path = require('path');
13
+ const util = require('util');
14
+ const mocha = require('mocha');
15
+ const winston = require('winston');
16
+ const { expect } = require('chai');
17
+ const { use } = require('chai');
18
+ const td = require('testdouble');
19
+
20
+ const anything = td.matchers.anything();
21
+
22
+ // stub and attemptTimeout are used throughout the code so set them here
23
+ let logLevel = 'none';
24
+ const isRapidFail = false;
25
+ const isSaveMockData = false;
26
+
27
+ // read in the properties from the sampleProperties files
28
+ let adaptdir = __dirname;
29
+ if (adaptdir.endsWith('/test/integration')) {
30
+ adaptdir = adaptdir.substring(0, adaptdir.length - 17);
31
+ } else if (adaptdir.endsWith('/test/unit')) {
32
+ adaptdir = adaptdir.substring(0, adaptdir.length - 10);
33
+ }
34
+ const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
35
+
36
+ // these variables can be changed to run in integrated mode so easier to set them here
37
+ // always check these in with bogus data!!!
38
+ samProps.stub = true;
39
+ samProps.host = 'replace.hostorip.here';
40
+ samProps.authentication.username = 'username';
41
+ samProps.authentication.password = 'password';
42
+ samProps.protocol = 'http';
43
+ samProps.port = 80;
44
+ samProps.ssl.enabled = false;
45
+ samProps.ssl.accept_invalid_cert = false;
46
+ if (samProps.request.attempt_timeout < 30000) {
47
+ samProps.request.attempt_timeout = 30000;
48
+ }
49
+ const attemptTimeout = samProps.request.attempt_timeout;
50
+ const { stub } = samProps;
51
+
52
+ // these are the adapter properties. You generally should not need to alter
53
+ // any of these after they are initially set up
54
+ global.pronghornProps = {
55
+ pathProps: {
56
+ encrypted: false
57
+ },
58
+ adapterProps: {
59
+ adapters: [{
60
+ id: 'Test-godaddy',
61
+ type: 'Godaddy',
62
+ properties: samProps
63
+ }]
64
+ }
65
+ };
66
+
67
+ global.$HOME = `${__dirname}/../..`;
68
+
69
+ // set the log levels that Pronghorn uses, spam and trace are not defaulted in so without
70
+ // this you may error on log.trace calls.
71
+ const myCustomLevels = {
72
+ levels: {
73
+ spam: 6,
74
+ trace: 5,
75
+ debug: 4,
76
+ info: 3,
77
+ warn: 2,
78
+ error: 1,
79
+ none: 0
80
+ }
81
+ };
82
+
83
+ // need to see if there is a log level passed in
84
+ process.argv.forEach((val) => {
85
+ // is there a log level defined to be passed in?
86
+ if (val.indexOf('--LOG') === 0) {
87
+ // get the desired log level
88
+ const inputVal = val.split('=')[1];
89
+
90
+ // validate the log level is supported, if so set it
91
+ if (Object.hasOwnProperty.call(myCustomLevels.levels, inputVal)) {
92
+ logLevel = inputVal;
93
+ }
94
+ }
95
+ });
96
+
97
+ // need to set global logging
98
+ global.log = winston.createLogger({
99
+ level: logLevel,
100
+ levels: myCustomLevels.levels,
101
+ transports: [
102
+ new winston.transports.Console()
103
+ ]
104
+ });
105
+
106
+ /**
107
+ * Runs the common asserts for test
108
+ */
109
+ function runCommonAsserts(data, error) {
110
+ assert.equal(undefined, error);
111
+ assert.notEqual(undefined, data);
112
+ assert.notEqual(null, data);
113
+ assert.notEqual(undefined, data.response);
114
+ assert.notEqual(null, data.response);
115
+ }
116
+
117
+ /**
118
+ * Runs the error asserts for the test
119
+ */
120
+ function runErrorAsserts(data, error, code, origin, displayStr) {
121
+ assert.equal(null, data);
122
+ assert.notEqual(undefined, error);
123
+ assert.notEqual(null, error);
124
+ assert.notEqual(undefined, error.IAPerror);
125
+ assert.notEqual(null, error.IAPerror);
126
+ assert.notEqual(undefined, error.IAPerror.displayString);
127
+ assert.notEqual(null, error.IAPerror.displayString);
128
+ assert.equal(code, error.icode);
129
+ assert.equal(origin, error.IAPerror.origin);
130
+ assert.equal(displayStr, error.IAPerror.displayString);
131
+ }
132
+
133
+ /**
134
+ * @function saveMockData
135
+ * Attempts to take data from responses and place them in MockDataFiles to help create Mockdata.
136
+ * Note, this was built based on entity file structure for Adapter-Engine 1.6.x
137
+ * @param {string} entityName - Name of the entity saving mock data for
138
+ * @param {string} actionName - Name of the action saving mock data for
139
+ * @param {string} descriptor - Something to describe this test (used as a type)
140
+ * @param {string or object} responseData - The data to put in the mock file.
141
+ */
142
+ function saveMockData(entityName, actionName, descriptor, responseData) {
143
+ // do not need to save mockdata if we are running in stub mode (already has mock data) or if told not to save
144
+ if (stub || !isSaveMockData) {
145
+ return false;
146
+ }
147
+
148
+ // must have a response in order to store the response
149
+ if (responseData && responseData.response) {
150
+ let data = responseData.response;
151
+
152
+ // if there was a raw response that one is better as it is untranslated
153
+ if (responseData.raw) {
154
+ data = responseData.raw;
155
+
156
+ try {
157
+ const temp = JSON.parse(data);
158
+ data = temp;
159
+ } catch (pex) {
160
+ // do not care if it did not parse as we will just use data
161
+ }
162
+ }
163
+
164
+ try {
165
+ const base = path.join(__dirname, `../../entities/${entityName}/`);
166
+ const mockdatafolder = 'mockdatafiles';
167
+ const filename = `mockdatafiles/${actionName}-${descriptor}.json`;
168
+
169
+ if (!fs.existsSync(base + mockdatafolder)) {
170
+ fs.mkdirSync(base + mockdatafolder);
171
+ }
172
+
173
+ // write the data we retrieved
174
+ fs.writeFile(base + filename, JSON.stringify(data, null, 2), 'utf8', (errWritingMock) => {
175
+ if (errWritingMock) throw errWritingMock;
176
+
177
+ // update the action file to reflect the changes. Note: We're replacing the default object for now!
178
+ fs.readFile(`${base}action.json`, (errRead, content) => {
179
+ if (errRead) throw errRead;
180
+
181
+ // parse the action file into JSON
182
+ const parsedJson = JSON.parse(content);
183
+
184
+ // The object update we'll write in.
185
+ const responseObj = {
186
+ type: descriptor,
187
+ key: '',
188
+ mockFile: filename
189
+ };
190
+
191
+ // get the object for method we're trying to change.
192
+ const currentMethodAction = parsedJson.actions.find((obj) => obj.name === actionName);
193
+
194
+ // if the method was not found - should never happen but...
195
+ if (!currentMethodAction) {
196
+ throw Error('Can\'t find an action for this method in the provided entity.');
197
+ }
198
+
199
+ // if there is a response object, we want to replace the Response object. Otherwise we'll create one.
200
+ const actionResponseObj = currentMethodAction.responseObjects.find((obj) => obj.type === descriptor);
201
+
202
+ // Add the action responseObj back into the array of response objects.
203
+ if (!actionResponseObj) {
204
+ // if there is a default response object, we want to get the key.
205
+ const defaultResponseObj = currentMethodAction.responseObjects.find((obj) => obj.type === 'default');
206
+
207
+ // save the default key into the new response object
208
+ if (defaultResponseObj) {
209
+ responseObj.key = defaultResponseObj.key;
210
+ }
211
+
212
+ // save the new response object
213
+ currentMethodAction.responseObjects = [responseObj];
214
+ } else {
215
+ // update the location of the mock data file
216
+ actionResponseObj.mockFile = responseObj.mockFile;
217
+ }
218
+
219
+ // Save results
220
+ fs.writeFile(`${base}action.json`, JSON.stringify(parsedJson, null, 2), (err) => {
221
+ if (err) throw err;
222
+ });
223
+ });
224
+ });
225
+ } catch (e) {
226
+ log.debug(`Failed to save mock data for ${actionName}. ${e.message}`);
227
+ return false;
228
+ }
229
+ }
230
+
231
+ // no response to save
232
+ log.debug(`No data passed to save into mockdata for ${actionName}`);
233
+ return false;
234
+ }
235
+
236
+ // require the adapter that we are going to be using
237
+ const Godaddy = require('../../adapter');
238
+
239
+ // begin the testing - these should be pretty well defined between the describe and the it!
240
+ describe('[integration] Godaddy Adapter Test', () => {
241
+ describe('Godaddy Class Tests', () => {
242
+ const a = new Godaddy(
243
+ pronghornProps.adapterProps.adapters[0].id,
244
+ pronghornProps.adapterProps.adapters[0].properties
245
+ );
246
+
247
+ if (isRapidFail) {
248
+ const state = {};
249
+ state.passed = true;
250
+
251
+ mocha.afterEach(function x() {
252
+ state.passed = state.passed
253
+ && (this.currentTest.state === 'passed');
254
+ });
255
+ mocha.beforeEach(function x() {
256
+ if (!state.passed) {
257
+ return this.currentTest.skip();
258
+ }
259
+ return true;
260
+ });
261
+ }
262
+
263
+ describe('#class instance created', () => {
264
+ it('should be a class with properties', (done) => {
265
+ try {
266
+ assert.notEqual(null, a);
267
+ assert.notEqual(undefined, a);
268
+ const checkId = global.pronghornProps.adapterProps.adapters[0].id;
269
+ assert.equal(checkId, a.id);
270
+ assert.notEqual(null, a.allProps);
271
+ const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
272
+ assert.equal(check, a.healthcheckType);
273
+ done();
274
+ } catch (error) {
275
+ log.error(`Test Failure: ${error}`);
276
+ done(error);
277
+ }
278
+ }).timeout(attemptTimeout);
279
+ });
280
+
281
+ describe('#connect', () => {
282
+ it('should get connected - no healthcheck', (done) => {
283
+ try {
284
+ a.healthcheckType = 'none';
285
+ a.connect();
286
+
287
+ try {
288
+ assert.equal(true, a.alive);
289
+ done();
290
+ } catch (error) {
291
+ log.error(`Test Failure: ${error}`);
292
+ done(error);
293
+ }
294
+ } catch (error) {
295
+ log.error(`Adapter Exception: ${error}`);
296
+ done(error);
297
+ }
298
+ });
299
+ it('should get connected - startup healthcheck', (done) => {
300
+ try {
301
+ a.healthcheckType = 'startup';
302
+ a.connect();
303
+
304
+ try {
305
+ assert.equal(true, a.alive);
306
+ done();
307
+ } catch (error) {
308
+ log.error(`Test Failure: ${error}`);
309
+ done(error);
310
+ }
311
+ } catch (error) {
312
+ log.error(`Adapter Exception: ${error}`);
313
+ done(error);
314
+ }
315
+ });
316
+ });
317
+
318
+ describe('#healthCheck', () => {
319
+ it('should be healthy', (done) => {
320
+ try {
321
+ a.healthCheck(null, (data) => {
322
+ try {
323
+ assert.equal(true, a.healthy);
324
+ saveMockData('system', 'healthcheck', 'default', data);
325
+ done();
326
+ } catch (err) {
327
+ log.error(`Test Failure: ${err}`);
328
+ done(err);
329
+ }
330
+ });
331
+ } catch (error) {
332
+ log.error(`Adapter Exception: ${error}`);
333
+ done(error);
334
+ }
335
+ }).timeout(attemptTimeout);
336
+ });
337
+
338
+ // broker tests
339
+ describe('#getDevicesFiltered - errors', () => {
340
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
341
+ try {
342
+ const opts = {
343
+ filter: {
344
+ name: 'deviceName'
345
+ }
346
+ };
347
+ a.getDevicesFiltered(opts, (data, error) => {
348
+ try {
349
+ if (stub) {
350
+ if (samProps.devicebroker.getDevicesFiltered[0].handleFailure === 'ignore') {
351
+ assert.equal(null, error);
352
+ assert.notEqual(undefined, data);
353
+ assert.notEqual(null, data);
354
+ assert.equal(0, data.total);
355
+ assert.equal(0, data.list.length);
356
+ } else {
357
+ const displayE = 'Error 400 received on request';
358
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
359
+ }
360
+ } else {
361
+ runCommonAsserts(data, error);
362
+ }
363
+ done();
364
+ } catch (err) {
365
+ log.error(`Test Failure: ${err}`);
366
+ done(err);
367
+ }
368
+ });
369
+ } catch (error) {
370
+ log.error(`Adapter Exception: ${error}`);
371
+ done(error);
372
+ }
373
+ }).timeout(attemptTimeout);
374
+ });
375
+
376
+ describe('#iapGetDeviceCount - errors', () => {
377
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
378
+ try {
379
+ const opts = {
380
+ filter: {
381
+ name: 'deviceName'
382
+ }
383
+ };
384
+ a.iapGetDeviceCount((data, error) => {
385
+ try {
386
+ if (stub) {
387
+ if (samProps.devicebroker.getDevicesFiltered[0].handleFailure === 'ignore') {
388
+ assert.equal(null, error);
389
+ assert.notEqual(undefined, data);
390
+ assert.notEqual(null, data);
391
+ assert.equal(0, data.count);
392
+ } else {
393
+ const displayE = 'Error 400 received on request';
394
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
395
+ }
396
+ } else {
397
+ runCommonAsserts(data, error);
398
+ }
399
+ done();
400
+ } catch (err) {
401
+ log.error(`Test Failure: ${err}`);
402
+ done(err);
403
+ }
404
+ });
405
+ } catch (error) {
406
+ log.error(`Adapter Exception: ${error}`);
407
+ done(error);
408
+ }
409
+ }).timeout(attemptTimeout);
410
+ });
411
+
412
+ // exposed cache tests
413
+ describe('#iapPopulateEntityCache - errors', () => {
414
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
415
+ try {
416
+ a.iapPopulateEntityCache('Device', (data, error) => {
417
+ try {
418
+ if (stub) {
419
+ assert.equal(null, data);
420
+ assert.notEqual(undefined, error);
421
+ assert.notEqual(null, error);
422
+ done();
423
+ } else {
424
+ assert.equal(undefined, error);
425
+ assert.equal('success', data[0]);
426
+ done();
427
+ }
428
+ } catch (err) {
429
+ log.error(`Test Failure: ${err}`);
430
+ done(err);
431
+ }
432
+ });
433
+ } catch (error) {
434
+ log.error(`Adapter Exception: ${error}`);
435
+ done(error);
436
+ }
437
+ }).timeout(attemptTimeout);
438
+ });
439
+
440
+ describe('#iapRetrieveEntitiesCache - errors', () => {
441
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
442
+ try {
443
+ a.iapRetrieveEntitiesCache('Device', {}, (data, error) => {
444
+ try {
445
+ if (stub) {
446
+ assert.equal(null, data);
447
+ assert.notEqual(null, error);
448
+ assert.notEqual(undefined, error);
449
+ } else {
450
+ assert.equal(undefined, error);
451
+ assert.notEqual(null, data);
452
+ assert.notEqual(undefined, data);
453
+ }
454
+ done();
455
+ } catch (err) {
456
+ log.error(`Test Failure: ${err}`);
457
+ done(err);
458
+ }
459
+ });
460
+ } catch (error) {
461
+ log.error(`Adapter Exception: ${error}`);
462
+ done(error);
463
+ }
464
+ }).timeout(attemptTimeout);
465
+ });
466
+ /*
467
+ -----------------------------------------------------------------------
468
+ -----------------------------------------------------------------------
469
+ *** All code above this comment will be replaced during a migration ***
470
+ ******************* DO NOT REMOVE THIS COMMENT BLOCK ******************
471
+ -----------------------------------------------------------------------
472
+ -----------------------------------------------------------------------
473
+ */
474
+
475
+ const aftermarketAddExpiryListingsBodyParam = [
476
+ {}
477
+ ];
478
+ describe('#addExpiryListings - errors', () => {
479
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
480
+ try {
481
+ a.addExpiryListings(aftermarketAddExpiryListingsBodyParam, (data, error) => {
482
+ try {
483
+ if (stub) {
484
+ const displayE = 'Error 400 received on request';
485
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
486
+ } else {
487
+ runCommonAsserts(data, error);
488
+ }
489
+ saveMockData('Aftermarket', 'addExpiryListings', 'default', data);
490
+ done();
491
+ } catch (err) {
492
+ log.error(`Test Failure: ${err}`);
493
+ done(err);
494
+ }
495
+ });
496
+ } catch (error) {
497
+ log.error(`Adapter Exception: ${error}`);
498
+ done(error);
499
+ }
500
+ }).timeout(attemptTimeout);
501
+ });
502
+
503
+ const abuseCreateTicketBodyParam = {
504
+ info: 'string',
505
+ infoUrl: 'string',
506
+ intentional: true,
507
+ proxy: 'string',
508
+ source: 'string',
509
+ target: 'string',
510
+ type: 'CONTENT'
511
+ };
512
+ describe('#createTicket - errors', () => {
513
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
514
+ try {
515
+ a.createTicket(abuseCreateTicketBodyParam, (data, error) => {
516
+ try {
517
+ if (stub) {
518
+ const displayE = 'Error 400 received on request';
519
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
520
+ } else {
521
+ runCommonAsserts(data, error);
522
+ }
523
+ saveMockData('Abuse', 'createTicket', 'default', data);
524
+ done();
525
+ } catch (err) {
526
+ log.error(`Test Failure: ${err}`);
527
+ done(err);
528
+ }
529
+ });
530
+ } catch (error) {
531
+ log.error(`Adapter Exception: ${error}`);
532
+ done(error);
533
+ }
534
+ }).timeout(attemptTimeout);
535
+ });
536
+
537
+ describe('#getTickets - errors', () => {
538
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
539
+ try {
540
+ a.getTickets(null, null, null, null, null, null, null, null, (data, error) => {
541
+ try {
542
+ if (stub) {
543
+ const displayE = 'Error 400 received on request';
544
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
545
+ } else {
546
+ runCommonAsserts(data, error);
547
+ }
548
+ saveMockData('Abuse', 'getTickets', 'default', data);
549
+ done();
550
+ } catch (err) {
551
+ log.error(`Test Failure: ${err}`);
552
+ done(err);
553
+ }
554
+ });
555
+ } catch (error) {
556
+ log.error(`Adapter Exception: ${error}`);
557
+ done(error);
558
+ }
559
+ }).timeout(attemptTimeout);
560
+ });
561
+
562
+ const abuseTicketId = 'fakedata';
563
+ describe('#getTicketInfo - errors', () => {
564
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
565
+ try {
566
+ a.getTicketInfo(abuseTicketId, (data, error) => {
567
+ try {
568
+ if (stub) {
569
+ const displayE = 'Error 400 received on request';
570
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
571
+ } else {
572
+ runCommonAsserts(data, error);
573
+ }
574
+ saveMockData('Abuse', 'getTicketInfo', 'default', data);
575
+ done();
576
+ } catch (err) {
577
+ log.error(`Test Failure: ${err}`);
578
+ done(err);
579
+ }
580
+ });
581
+ } catch (error) {
582
+ log.error(`Adapter Exception: ${error}`);
583
+ done(error);
584
+ }
585
+ }).timeout(attemptTimeout);
586
+ });
587
+
588
+ const agreementsKeys = [];
589
+ describe('#getAgreements - errors', () => {
590
+ it('should work if integrated or standalone with mockdata', (done) => {
591
+ try {
592
+ a.getAgreements(agreementsKeys, (data, error) => {
593
+ try {
594
+ if (stub) {
595
+ runCommonAsserts(data, error);
596
+ assert.equal('object', typeof data.response[0]);
597
+ } else {
598
+ runCommonAsserts(data, error);
599
+ }
600
+ saveMockData('Agreements', 'getAgreements', 'default', data);
601
+ done();
602
+ } catch (err) {
603
+ log.error(`Test Failure: ${err}`);
604
+ done(err);
605
+ }
606
+ });
607
+ } catch (error) {
608
+ log.error(`Adapter Exception: ${error}`);
609
+ done(error);
610
+ }
611
+ }).timeout(attemptTimeout);
612
+ });
613
+
614
+ const certificateCertificateCreateBodyParam = {
615
+ contact: {},
616
+ csr: 'string',
617
+ period: 2,
618
+ productType: 'EV_SSL'
619
+ };
620
+ describe('#certificateCreate - errors', () => {
621
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
622
+ try {
623
+ a.certificateCreate(certificateCertificateCreateBodyParam, (data, error) => {
624
+ try {
625
+ if (stub) {
626
+ const displayE = 'Error 400 received on request';
627
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
628
+ } else {
629
+ runCommonAsserts(data, error);
630
+ }
631
+ saveMockData('Certificate', 'certificateCreate', 'default', data);
632
+ done();
633
+ } catch (err) {
634
+ log.error(`Test Failure: ${err}`);
635
+ done(err);
636
+ }
637
+ });
638
+ } catch (error) {
639
+ log.error(`Adapter Exception: ${error}`);
640
+ done(error);
641
+ }
642
+ }).timeout(attemptTimeout);
643
+ });
644
+
645
+ const certificateCertificateValidateBodyParam = {
646
+ contact: {},
647
+ csr: 'string',
648
+ period: 2,
649
+ productType: 'OV_WILDCARD_SSL'
650
+ };
651
+ describe('#certificateValidate - errors', () => {
652
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
653
+ try {
654
+ a.certificateValidate(certificateCertificateValidateBodyParam, (data, error) => {
655
+ try {
656
+ if (stub) {
657
+ const displayE = 'Error 400 received on request';
658
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
659
+ } else {
660
+ runCommonAsserts(data, error);
661
+ }
662
+ saveMockData('Certificate', 'certificateValidate', 'default', data);
663
+ done();
664
+ } catch (err) {
665
+ log.error(`Test Failure: ${err}`);
666
+ done(err);
667
+ }
668
+ });
669
+ } catch (error) {
670
+ log.error(`Adapter Exception: ${error}`);
671
+ done(error);
672
+ }
673
+ }).timeout(attemptTimeout);
674
+ });
675
+
676
+ const certificateCertificateId = 'fakedata';
677
+ describe('#certificateCancel - errors', () => {
678
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
679
+ try {
680
+ a.certificateCancel(certificateCertificateId, (data, error) => {
681
+ try {
682
+ if (stub) {
683
+ const displayE = 'Error 400 received on request';
684
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
685
+ } else {
686
+ runCommonAsserts(data, error);
687
+ }
688
+ saveMockData('Certificate', 'certificateCancel', 'default', data);
689
+ done();
690
+ } catch (err) {
691
+ log.error(`Test Failure: ${err}`);
692
+ done(err);
693
+ }
694
+ });
695
+ } catch (error) {
696
+ log.error(`Adapter Exception: ${error}`);
697
+ done(error);
698
+ }
699
+ }).timeout(attemptTimeout);
700
+ });
701
+
702
+ const certificateEmailAddress = 'fakedata';
703
+ describe('#certificateAlternateEmailAddress - errors', () => {
704
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
705
+ try {
706
+ a.certificateAlternateEmailAddress(certificateCertificateId, certificateEmailAddress, (data, error) => {
707
+ try {
708
+ if (stub) {
709
+ const displayE = 'Error 400 received on request';
710
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
711
+ } else {
712
+ runCommonAsserts(data, error);
713
+ }
714
+ saveMockData('Certificate', 'certificateAlternateEmailAddress', 'default', data);
715
+ done();
716
+ } catch (err) {
717
+ log.error(`Test Failure: ${err}`);
718
+ done(err);
719
+ }
720
+ });
721
+ } catch (error) {
722
+ log.error(`Adapter Exception: ${error}`);
723
+ done(error);
724
+ }
725
+ }).timeout(attemptTimeout);
726
+ });
727
+
728
+ const certificateEmailId = 'fakedata';
729
+ describe('#certificateResendEmail - errors', () => {
730
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
731
+ try {
732
+ a.certificateResendEmail(certificateCertificateId, certificateEmailId, (data, error) => {
733
+ try {
734
+ if (stub) {
735
+ const displayE = 'Error 400 received on request';
736
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
737
+ } else {
738
+ runCommonAsserts(data, error);
739
+ }
740
+ saveMockData('Certificate', 'certificateResendEmail', 'default', data);
741
+ done();
742
+ } catch (err) {
743
+ log.error(`Test Failure: ${err}`);
744
+ done(err);
745
+ }
746
+ });
747
+ } catch (error) {
748
+ log.error(`Adapter Exception: ${error}`);
749
+ done(error);
750
+ }
751
+ }).timeout(attemptTimeout);
752
+ });
753
+
754
+ describe('#certificateResendEmailAddress - errors', () => {
755
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
756
+ try {
757
+ a.certificateResendEmailAddress(certificateCertificateId, certificateEmailId, certificateEmailAddress, (data, error) => {
758
+ try {
759
+ if (stub) {
760
+ const displayE = 'Error 400 received on request';
761
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
762
+ } else {
763
+ runCommonAsserts(data, error);
764
+ }
765
+ saveMockData('Certificate', 'certificateResendEmailAddress', 'default', data);
766
+ done();
767
+ } catch (err) {
768
+ log.error(`Test Failure: ${err}`);
769
+ done(err);
770
+ }
771
+ });
772
+ } catch (error) {
773
+ log.error(`Adapter Exception: ${error}`);
774
+ done(error);
775
+ }
776
+ }).timeout(attemptTimeout);
777
+ });
778
+
779
+ const certificateCertificateReissueBodyParam = {
780
+ callbackUrl: 'string',
781
+ commonName: 'Existing common name',
782
+ csr: 'Existing CSR',
783
+ delayExistingRevoke: 72,
784
+ rootType: 'GODADDY_SHA_1',
785
+ subjectAlternativeNames: [
786
+ 'string'
787
+ ],
788
+ forceDomainRevetting: [
789
+ 'string'
790
+ ]
791
+ };
792
+ describe('#certificateReissue - errors', () => {
793
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
794
+ try {
795
+ a.certificateReissue(certificateCertificateId, certificateCertificateReissueBodyParam, (data, error) => {
796
+ try {
797
+ if (stub) {
798
+ const displayE = 'Error 400 received on request';
799
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
800
+ } else {
801
+ runCommonAsserts(data, error);
802
+ }
803
+ saveMockData('Certificate', 'certificateReissue', 'default', data);
804
+ done();
805
+ } catch (err) {
806
+ log.error(`Test Failure: ${err}`);
807
+ done(err);
808
+ }
809
+ });
810
+ } catch (error) {
811
+ log.error(`Adapter Exception: ${error}`);
812
+ done(error);
813
+ }
814
+ }).timeout(attemptTimeout);
815
+ });
816
+
817
+ const certificateCertificateRenewBodyParam = {
818
+ callbackUrl: 'string',
819
+ commonName: 'Existing common name',
820
+ csr: 'Existing CSR',
821
+ period: 9,
822
+ rootType: 'GODADDY_SHA_1',
823
+ subjectAlternativeNames: [
824
+ 'string'
825
+ ]
826
+ };
827
+ describe('#certificateRenew - errors', () => {
828
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
829
+ try {
830
+ a.certificateRenew(certificateCertificateId, certificateCertificateRenewBodyParam, (data, error) => {
831
+ try {
832
+ if (stub) {
833
+ const displayE = 'Error 400 received on request';
834
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
835
+ } else {
836
+ runCommonAsserts(data, error);
837
+ }
838
+ saveMockData('Certificate', 'certificateRenew', 'default', data);
839
+ done();
840
+ } catch (err) {
841
+ log.error(`Test Failure: ${err}`);
842
+ done(err);
843
+ }
844
+ });
845
+ } catch (error) {
846
+ log.error(`Adapter Exception: ${error}`);
847
+ done(error);
848
+ }
849
+ }).timeout(attemptTimeout);
850
+ });
851
+
852
+ const certificateCertificateRevokeBodyParam = {
853
+ reason: 'PRIVILEGE_WITHDRAWN'
854
+ };
855
+ describe('#certificateRevoke - errors', () => {
856
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
857
+ try {
858
+ a.certificateRevoke(certificateCertificateId, certificateCertificateRevokeBodyParam, (data, error) => {
859
+ try {
860
+ if (stub) {
861
+ const displayE = 'Error 400 received on request';
862
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
863
+ } else {
864
+ runCommonAsserts(data, error);
865
+ }
866
+ saveMockData('Certificate', 'certificateRevoke', 'default', data);
867
+ done();
868
+ } catch (err) {
869
+ log.error(`Test Failure: ${err}`);
870
+ done(err);
871
+ }
872
+ });
873
+ } catch (error) {
874
+ log.error(`Adapter Exception: ${error}`);
875
+ done(error);
876
+ }
877
+ }).timeout(attemptTimeout);
878
+ });
879
+
880
+ describe('#certificateVerifydomaincontrol - errors', () => {
881
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
882
+ try {
883
+ a.certificateVerifydomaincontrol(certificateCertificateId, (data, error) => {
884
+ try {
885
+ if (stub) {
886
+ const displayE = 'Error 400 received on request';
887
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
888
+ } else {
889
+ runCommonAsserts(data, error);
890
+ }
891
+ saveMockData('Certificate', 'certificateVerifydomaincontrol', 'default', data);
892
+ done();
893
+ } catch (err) {
894
+ log.error(`Test Failure: ${err}`);
895
+ done(err);
896
+ }
897
+ });
898
+ } catch (error) {
899
+ log.error(`Adapter Exception: ${error}`);
900
+ done(error);
901
+ }
902
+ }).timeout(attemptTimeout);
903
+ });
904
+
905
+ describe('#certificateGet - errors', () => {
906
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
907
+ try {
908
+ a.certificateGet(certificateCertificateId, (data, error) => {
909
+ try {
910
+ if (stub) {
911
+ const displayE = 'Error 400 received on request';
912
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
913
+ } else {
914
+ runCommonAsserts(data, error);
915
+ }
916
+ saveMockData('Certificate', 'certificateGet', 'default', data);
917
+ done();
918
+ } catch (err) {
919
+ log.error(`Test Failure: ${err}`);
920
+ done(err);
921
+ }
922
+ });
923
+ } catch (error) {
924
+ log.error(`Adapter Exception: ${error}`);
925
+ done(error);
926
+ }
927
+ }).timeout(attemptTimeout);
928
+ });
929
+
930
+ describe('#certificateActionRetrieve - errors', () => {
931
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
932
+ try {
933
+ a.certificateActionRetrieve(certificateCertificateId, (data, error) => {
934
+ try {
935
+ if (stub) {
936
+ const displayE = 'Error 400 received on request';
937
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
938
+ } else {
939
+ runCommonAsserts(data, error);
940
+ }
941
+ saveMockData('Certificate', 'certificateActionRetrieve', 'default', data);
942
+ done();
943
+ } catch (err) {
944
+ log.error(`Test Failure: ${err}`);
945
+ done(err);
946
+ }
947
+ });
948
+ } catch (error) {
949
+ log.error(`Adapter Exception: ${error}`);
950
+ done(error);
951
+ }
952
+ }).timeout(attemptTimeout);
953
+ });
954
+
955
+ const certificateCallbackUrl = 'fakedata';
956
+ describe('#certificateCallbackReplace - errors', () => {
957
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
958
+ try {
959
+ a.certificateCallbackReplace(certificateCertificateId, certificateCallbackUrl, (data, error) => {
960
+ try {
961
+ if (stub) {
962
+ const displayE = 'Error 400 received on request';
963
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
964
+ } else {
965
+ runCommonAsserts(data, error);
966
+ }
967
+ saveMockData('Certificate', 'certificateCallbackReplace', 'default', data);
968
+ done();
969
+ } catch (err) {
970
+ log.error(`Test Failure: ${err}`);
971
+ done(err);
972
+ }
973
+ });
974
+ } catch (error) {
975
+ log.error(`Adapter Exception: ${error}`);
976
+ done(error);
977
+ }
978
+ }).timeout(attemptTimeout);
979
+ });
980
+
981
+ describe('#certificateCallbackGet - errors', () => {
982
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
983
+ try {
984
+ a.certificateCallbackGet(certificateCertificateId, (data, error) => {
985
+ try {
986
+ if (stub) {
987
+ const displayE = 'Error 400 received on request';
988
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
989
+ } else {
990
+ runCommonAsserts(data, error);
991
+ }
992
+ saveMockData('Certificate', 'certificateCallbackGet', 'default', data);
993
+ done();
994
+ } catch (err) {
995
+ log.error(`Test Failure: ${err}`);
996
+ done(err);
997
+ }
998
+ });
999
+ } catch (error) {
1000
+ log.error(`Adapter Exception: ${error}`);
1001
+ done(error);
1002
+ }
1003
+ }).timeout(attemptTimeout);
1004
+ });
1005
+
1006
+ describe('#certificateDownload - errors', () => {
1007
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1008
+ try {
1009
+ a.certificateDownload(certificateCertificateId, (data, error) => {
1010
+ try {
1011
+ if (stub) {
1012
+ const displayE = 'Error 400 received on request';
1013
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1014
+ } else {
1015
+ runCommonAsserts(data, error);
1016
+ }
1017
+ saveMockData('Certificate', 'certificateDownload', 'default', data);
1018
+ done();
1019
+ } catch (err) {
1020
+ log.error(`Test Failure: ${err}`);
1021
+ done(err);
1022
+ }
1023
+ });
1024
+ } catch (error) {
1025
+ log.error(`Adapter Exception: ${error}`);
1026
+ done(error);
1027
+ }
1028
+ }).timeout(attemptTimeout);
1029
+ });
1030
+
1031
+ describe('#certificateEmailHistory - errors', () => {
1032
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1033
+ try {
1034
+ a.certificateEmailHistory(certificateCertificateId, (data, error) => {
1035
+ try {
1036
+ if (stub) {
1037
+ const displayE = 'Error 400 received on request';
1038
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1039
+ } else {
1040
+ runCommonAsserts(data, error);
1041
+ }
1042
+ saveMockData('Certificate', 'certificateEmailHistory', 'default', data);
1043
+ done();
1044
+ } catch (err) {
1045
+ log.error(`Test Failure: ${err}`);
1046
+ done(err);
1047
+ }
1048
+ });
1049
+ } catch (error) {
1050
+ log.error(`Adapter Exception: ${error}`);
1051
+ done(error);
1052
+ }
1053
+ }).timeout(attemptTimeout);
1054
+ });
1055
+
1056
+ describe('#certificateSitesealGet - errors', () => {
1057
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1058
+ try {
1059
+ a.certificateSitesealGet(certificateCertificateId, null, null, (data, error) => {
1060
+ try {
1061
+ if (stub) {
1062
+ const displayE = 'Error 400 received on request';
1063
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1064
+ } else {
1065
+ runCommonAsserts(data, error);
1066
+ }
1067
+ saveMockData('Certificate', 'certificateSitesealGet', 'default', data);
1068
+ done();
1069
+ } catch (err) {
1070
+ log.error(`Test Failure: ${err}`);
1071
+ done(err);
1072
+ }
1073
+ });
1074
+ } catch (error) {
1075
+ log.error(`Adapter Exception: ${error}`);
1076
+ done(error);
1077
+ }
1078
+ }).timeout(attemptTimeout);
1079
+ });
1080
+
1081
+ const certificateEntitlementId = 'fakedata';
1082
+ describe('#certificateGetEntitlement - errors', () => {
1083
+ it('should work if integrated or standalone with mockdata', (done) => {
1084
+ try {
1085
+ a.certificateGetEntitlement(certificateEntitlementId, null, (data, error) => {
1086
+ try {
1087
+ if (stub) {
1088
+ runCommonAsserts(data, error);
1089
+ assert.equal('object', typeof data.response[0]);
1090
+ assert.equal('object', typeof data.response[1]);
1091
+ assert.equal('object', typeof data.response[2]);
1092
+ } else {
1093
+ runCommonAsserts(data, error);
1094
+ }
1095
+ saveMockData('Certificate', 'certificateGetEntitlement', 'default', data);
1096
+ done();
1097
+ } catch (err) {
1098
+ log.error(`Test Failure: ${err}`);
1099
+ done(err);
1100
+ }
1101
+ });
1102
+ } catch (error) {
1103
+ log.error(`Adapter Exception: ${error}`);
1104
+ done(error);
1105
+ }
1106
+ }).timeout(attemptTimeout);
1107
+ });
1108
+
1109
+ describe('#certificateDownloadEntitlement - errors', () => {
1110
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1111
+ try {
1112
+ a.certificateDownloadEntitlement(certificateEntitlementId, (data, error) => {
1113
+ try {
1114
+ if (stub) {
1115
+ const displayE = 'Error 400 received on request';
1116
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1117
+ } else {
1118
+ runCommonAsserts(data, error);
1119
+ }
1120
+ saveMockData('Certificate', 'certificateDownloadEntitlement', 'default', data);
1121
+ done();
1122
+ } catch (err) {
1123
+ log.error(`Test Failure: ${err}`);
1124
+ done(err);
1125
+ }
1126
+ });
1127
+ } catch (error) {
1128
+ log.error(`Adapter Exception: ${error}`);
1129
+ done(error);
1130
+ }
1131
+ }).timeout(attemptTimeout);
1132
+ });
1133
+
1134
+ const certificateCustomerId = 'fakedata';
1135
+ describe('#getCustomerCertificatesByCustomerId - errors', () => {
1136
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1137
+ try {
1138
+ a.getCustomerCertificatesByCustomerId(certificateCustomerId, null, null, (data, error) => {
1139
+ try {
1140
+ if (stub) {
1141
+ const displayE = 'Error 400 received on request';
1142
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1143
+ } else {
1144
+ runCommonAsserts(data, error);
1145
+ }
1146
+ saveMockData('Certificate', 'getCustomerCertificatesByCustomerId', 'default', data);
1147
+ done();
1148
+ } catch (err) {
1149
+ log.error(`Test Failure: ${err}`);
1150
+ done(err);
1151
+ }
1152
+ });
1153
+ } catch (error) {
1154
+ log.error(`Adapter Exception: ${error}`);
1155
+ done(error);
1156
+ }
1157
+ }).timeout(attemptTimeout);
1158
+ });
1159
+
1160
+ describe('#getAcmeExternalAccountBinding - errors', () => {
1161
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1162
+ try {
1163
+ a.getAcmeExternalAccountBinding(certificateCustomerId, (data, error) => {
1164
+ try {
1165
+ if (stub) {
1166
+ const displayE = 'Error 400 received on request';
1167
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1168
+ } else {
1169
+ runCommonAsserts(data, error);
1170
+ }
1171
+ saveMockData('Certificate', 'getAcmeExternalAccountBinding', 'default', data);
1172
+ done();
1173
+ } catch (err) {
1174
+ log.error(`Test Failure: ${err}`);
1175
+ done(err);
1176
+ }
1177
+ });
1178
+ } catch (error) {
1179
+ log.error(`Adapter Exception: ${error}`);
1180
+ done(error);
1181
+ }
1182
+ }).timeout(attemptTimeout);
1183
+ });
1184
+
1185
+ describe('#getCertificateDetailByCertIdentifier - errors', () => {
1186
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1187
+ try {
1188
+ a.getCertificateDetailByCertIdentifier(certificateCustomerId, certificateCertificateId, (data, error) => {
1189
+ try {
1190
+ if (stub) {
1191
+ const displayE = 'Error 400 received on request';
1192
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1193
+ } else {
1194
+ runCommonAsserts(data, error);
1195
+ }
1196
+ saveMockData('Certificate', 'getCertificateDetailByCertIdentifier', 'default', data);
1197
+ done();
1198
+ } catch (err) {
1199
+ log.error(`Test Failure: ${err}`);
1200
+ done(err);
1201
+ }
1202
+ });
1203
+ } catch (error) {
1204
+ log.error(`Adapter Exception: ${error}`);
1205
+ done(error);
1206
+ }
1207
+ }).timeout(attemptTimeout);
1208
+ });
1209
+
1210
+ describe('#getDomainInformationByCertificateId - errors', () => {
1211
+ it('should work if integrated or standalone with mockdata', (done) => {
1212
+ try {
1213
+ a.getDomainInformationByCertificateId(certificateCustomerId, certificateCertificateId, (data, error) => {
1214
+ try {
1215
+ if (stub) {
1216
+ runCommonAsserts(data, error);
1217
+ assert.equal('object', typeof data.response[0]);
1218
+ assert.equal('object', typeof data.response[1]);
1219
+ assert.equal('object', typeof data.response[2]);
1220
+ } else {
1221
+ runCommonAsserts(data, error);
1222
+ }
1223
+ saveMockData('Certificate', 'getDomainInformationByCertificateId', 'default', data);
1224
+ done();
1225
+ } catch (err) {
1226
+ log.error(`Test Failure: ${err}`);
1227
+ done(err);
1228
+ }
1229
+ });
1230
+ } catch (error) {
1231
+ log.error(`Adapter Exception: ${error}`);
1232
+ done(error);
1233
+ }
1234
+ }).timeout(attemptTimeout);
1235
+ });
1236
+
1237
+ const certificateDomain = 'fakedata';
1238
+ describe('#getDomainDetailsByDomain - errors', () => {
1239
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1240
+ try {
1241
+ a.getDomainDetailsByDomain(certificateCustomerId, certificateCertificateId, certificateDomain, (data, error) => {
1242
+ try {
1243
+ if (stub) {
1244
+ const displayE = 'Error 400 received on request';
1245
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1246
+ } else {
1247
+ runCommonAsserts(data, error);
1248
+ }
1249
+ saveMockData('Certificate', 'getDomainDetailsByDomain', 'default', data);
1250
+ done();
1251
+ } catch (err) {
1252
+ log.error(`Test Failure: ${err}`);
1253
+ done(err);
1254
+ }
1255
+ });
1256
+ } catch (error) {
1257
+ log.error(`Adapter Exception: ${error}`);
1258
+ done(error);
1259
+ }
1260
+ }).timeout(attemptTimeout);
1261
+ });
1262
+
1263
+ const countriesMarketId = 'fakedata';
1264
+ describe('#getCountries - errors', () => {
1265
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1266
+ try {
1267
+ a.getCountries(countriesMarketId, null, null, null, null, (data, error) => {
1268
+ try {
1269
+ if (stub) {
1270
+ const displayE = 'Error 400 received on request';
1271
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1272
+ } else {
1273
+ runCommonAsserts(data, error);
1274
+ }
1275
+ saveMockData('Countries', 'getCountries', 'default', data);
1276
+ done();
1277
+ } catch (err) {
1278
+ log.error(`Test Failure: ${err}`);
1279
+ done(err);
1280
+ }
1281
+ });
1282
+ } catch (error) {
1283
+ log.error(`Adapter Exception: ${error}`);
1284
+ done(error);
1285
+ }
1286
+ }).timeout(attemptTimeout);
1287
+ });
1288
+
1289
+ const countriesCountryKey = 'fakedata';
1290
+ describe('#getCountry - errors', () => {
1291
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1292
+ try {
1293
+ a.getCountry(countriesCountryKey, countriesMarketId, null, null, (data, error) => {
1294
+ try {
1295
+ if (stub) {
1296
+ const displayE = 'Error 400 received on request';
1297
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1298
+ } else {
1299
+ runCommonAsserts(data, error);
1300
+ }
1301
+ saveMockData('Countries', 'getCountry', 'default', data);
1302
+ done();
1303
+ } catch (err) {
1304
+ log.error(`Test Failure: ${err}`);
1305
+ done(err);
1306
+ }
1307
+ });
1308
+ } catch (error) {
1309
+ log.error(`Adapter Exception: ${error}`);
1310
+ done(error);
1311
+ }
1312
+ }).timeout(attemptTimeout);
1313
+ });
1314
+
1315
+ const domainsAvailableBulkBodyParam = [
1316
+ 'string'
1317
+ ];
1318
+ describe('#availableBulk - errors', () => {
1319
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1320
+ try {
1321
+ a.availableBulk(domainsAvailableBulkBodyParam, null, (data, error) => {
1322
+ try {
1323
+ if (stub) {
1324
+ const displayE = 'Error 400 received on request';
1325
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1326
+ } else {
1327
+ runCommonAsserts(data, error);
1328
+ }
1329
+ saveMockData('Domains', 'availableBulk', 'default', data);
1330
+ done();
1331
+ } catch (err) {
1332
+ log.error(`Test Failure: ${err}`);
1333
+ done(err);
1334
+ }
1335
+ });
1336
+ } catch (error) {
1337
+ log.error(`Adapter Exception: ${error}`);
1338
+ done(error);
1339
+ }
1340
+ }).timeout(attemptTimeout);
1341
+ });
1342
+
1343
+ const domainsContactsValidateBodyParam = {
1344
+ domains: [
1345
+ 'string'
1346
+ ]
1347
+ };
1348
+ describe('#contactsValidate - errors', () => {
1349
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1350
+ try {
1351
+ a.contactsValidate(null, domainsContactsValidateBodyParam, (data, error) => {
1352
+ try {
1353
+ if (stub) {
1354
+ const displayE = 'Error 400 received on request';
1355
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1356
+ } else {
1357
+ runCommonAsserts(data, error);
1358
+ }
1359
+ saveMockData('Domains', 'contactsValidate', 'default', data);
1360
+ done();
1361
+ } catch (err) {
1362
+ log.error(`Test Failure: ${err}`);
1363
+ done(err);
1364
+ }
1365
+ });
1366
+ } catch (error) {
1367
+ log.error(`Adapter Exception: ${error}`);
1368
+ done(error);
1369
+ }
1370
+ }).timeout(attemptTimeout);
1371
+ });
1372
+
1373
+ const domainsPurchaseBodyParam = {
1374
+ consent: {},
1375
+ domain: 'string'
1376
+ };
1377
+ describe('#purchase - errors', () => {
1378
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1379
+ try {
1380
+ a.purchase(domainsPurchaseBodyParam, (data, error) => {
1381
+ try {
1382
+ if (stub) {
1383
+ const displayE = 'Error 400 received on request';
1384
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1385
+ } else {
1386
+ runCommonAsserts(data, error);
1387
+ }
1388
+ saveMockData('Domains', 'purchase', 'default', data);
1389
+ done();
1390
+ } catch (err) {
1391
+ log.error(`Test Failure: ${err}`);
1392
+ done(err);
1393
+ }
1394
+ });
1395
+ } catch (error) {
1396
+ log.error(`Adapter Exception: ${error}`);
1397
+ done(error);
1398
+ }
1399
+ }).timeout(attemptTimeout);
1400
+ });
1401
+
1402
+ const domainsValidateBodyParam = {
1403
+ consent: {},
1404
+ domain: 'string'
1405
+ };
1406
+ describe('#validate - errors', () => {
1407
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1408
+ try {
1409
+ a.validate(domainsValidateBodyParam, (data, error) => {
1410
+ try {
1411
+ if (stub) {
1412
+ const displayE = 'Error 400 received on request';
1413
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1414
+ } else {
1415
+ runCommonAsserts(data, error);
1416
+ }
1417
+ saveMockData('Domains', 'validate', 'default', data);
1418
+ done();
1419
+ } catch (err) {
1420
+ log.error(`Test Failure: ${err}`);
1421
+ done(err);
1422
+ }
1423
+ });
1424
+ } catch (error) {
1425
+ log.error(`Adapter Exception: ${error}`);
1426
+ done(error);
1427
+ }
1428
+ }).timeout(attemptTimeout);
1429
+ });
1430
+
1431
+ const domainsDomain = 'fakedata';
1432
+ const domainsPurchasePrivacyBodyParam = {
1433
+ consent: {}
1434
+ };
1435
+ describe('#purchasePrivacy - errors', () => {
1436
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1437
+ try {
1438
+ a.purchasePrivacy(domainsDomain, domainsPurchasePrivacyBodyParam, (data, error) => {
1439
+ try {
1440
+ if (stub) {
1441
+ const displayE = 'Error 400 received on request';
1442
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1443
+ } else {
1444
+ runCommonAsserts(data, error);
1445
+ }
1446
+ saveMockData('Domains', 'purchasePrivacy', 'default', data);
1447
+ done();
1448
+ } catch (err) {
1449
+ log.error(`Test Failure: ${err}`);
1450
+ done(err);
1451
+ }
1452
+ });
1453
+ } catch (error) {
1454
+ log.error(`Adapter Exception: ${error}`);
1455
+ done(error);
1456
+ }
1457
+ }).timeout(attemptTimeout);
1458
+ });
1459
+
1460
+ const domainsRenewBodyParam = {
1461
+ period: 1
1462
+ };
1463
+ describe('#renew - errors', () => {
1464
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1465
+ try {
1466
+ a.renew(domainsDomain, domainsRenewBodyParam, (data, error) => {
1467
+ try {
1468
+ if (stub) {
1469
+ const displayE = 'Error 400 received on request';
1470
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1471
+ } else {
1472
+ runCommonAsserts(data, error);
1473
+ }
1474
+ saveMockData('Domains', 'renew', 'default', data);
1475
+ done();
1476
+ } catch (err) {
1477
+ log.error(`Test Failure: ${err}`);
1478
+ done(err);
1479
+ }
1480
+ });
1481
+ } catch (error) {
1482
+ log.error(`Adapter Exception: ${error}`);
1483
+ done(error);
1484
+ }
1485
+ }).timeout(attemptTimeout);
1486
+ });
1487
+
1488
+ const domainsTransferInBodyParam = {
1489
+ authCode: 'string',
1490
+ consent: {}
1491
+ };
1492
+ describe('#transferIn - errors', () => {
1493
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1494
+ try {
1495
+ a.transferIn(domainsDomain, domainsTransferInBodyParam, (data, error) => {
1496
+ try {
1497
+ if (stub) {
1498
+ const displayE = 'Error 400 received on request';
1499
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1500
+ } else {
1501
+ runCommonAsserts(data, error);
1502
+ }
1503
+ saveMockData('Domains', 'transferIn', 'default', data);
1504
+ done();
1505
+ } catch (err) {
1506
+ log.error(`Test Failure: ${err}`);
1507
+ done(err);
1508
+ }
1509
+ });
1510
+ } catch (error) {
1511
+ log.error(`Adapter Exception: ${error}`);
1512
+ done(error);
1513
+ }
1514
+ }).timeout(attemptTimeout);
1515
+ });
1516
+
1517
+ describe('#verifyEmail - errors', () => {
1518
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1519
+ try {
1520
+ a.verifyEmail(domainsDomain, (data, error) => {
1521
+ try {
1522
+ if (stub) {
1523
+ const displayE = 'Error 400 received on request';
1524
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1525
+ } else {
1526
+ runCommonAsserts(data, error);
1527
+ }
1528
+ saveMockData('Domains', 'verifyEmail', 'default', data);
1529
+ done();
1530
+ } catch (err) {
1531
+ log.error(`Test Failure: ${err}`);
1532
+ done(err);
1533
+ }
1534
+ });
1535
+ } catch (error) {
1536
+ log.error(`Adapter Exception: ${error}`);
1537
+ done(error);
1538
+ }
1539
+ }).timeout(attemptTimeout);
1540
+ });
1541
+
1542
+ const domainsCustomerId = 'fakedata';
1543
+ const domainsFqdn = 'fakedata';
1544
+ const domainsDomainsForwardsPostBodyParam = {
1545
+ type: 'REDIRECT_PERMANENT',
1546
+ url: 'string'
1547
+ };
1548
+ describe('#domainsForwardsPost - errors', () => {
1549
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1550
+ try {
1551
+ a.domainsForwardsPost(domainsCustomerId, domainsFqdn, domainsDomainsForwardsPostBodyParam, (data, error) => {
1552
+ try {
1553
+ if (stub) {
1554
+ const displayE = 'Error 400 received on request';
1555
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1556
+ } else {
1557
+ runCommonAsserts(data, error);
1558
+ }
1559
+ saveMockData('Domains', 'domainsForwardsPost', 'default', data);
1560
+ done();
1561
+ } catch (err) {
1562
+ log.error(`Test Failure: ${err}`);
1563
+ done(err);
1564
+ }
1565
+ });
1566
+ } catch (error) {
1567
+ log.error(`Adapter Exception: ${error}`);
1568
+ done(error);
1569
+ }
1570
+ }).timeout(attemptTimeout);
1571
+ });
1572
+
1573
+ const domainsPostV2CustomersCustomerIdDomainsDomainRedeemBodyParam = {
1574
+ consent: {}
1575
+ };
1576
+ describe('#postV2CustomersCustomerIdDomainsDomainRedeem - errors', () => {
1577
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1578
+ try {
1579
+ a.postV2CustomersCustomerIdDomainsDomainRedeem(domainsCustomerId, domainsDomain, domainsPostV2CustomersCustomerIdDomainsDomainRedeemBodyParam, (data, error) => {
1580
+ try {
1581
+ if (stub) {
1582
+ const displayE = 'Error 400 received on request';
1583
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1584
+ } else {
1585
+ runCommonAsserts(data, error);
1586
+ }
1587
+ saveMockData('Domains', 'postV2CustomersCustomerIdDomainsDomainRedeem', 'default', data);
1588
+ done();
1589
+ } catch (err) {
1590
+ log.error(`Test Failure: ${err}`);
1591
+ done(err);
1592
+ }
1593
+ });
1594
+ } catch (error) {
1595
+ log.error(`Adapter Exception: ${error}`);
1596
+ done(error);
1597
+ }
1598
+ }).timeout(attemptTimeout);
1599
+ });
1600
+
1601
+ const domainsRegistrar = 'fakedata';
1602
+ describe('#postV2CustomersCustomerIdDomainsDomainTransferOut - errors', () => {
1603
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1604
+ try {
1605
+ a.postV2CustomersCustomerIdDomainsDomainTransferOut(domainsCustomerId, domainsDomain, domainsRegistrar, (data, error) => {
1606
+ try {
1607
+ if (stub) {
1608
+ const displayE = 'Error 400 received on request';
1609
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1610
+ } else {
1611
+ runCommonAsserts(data, error);
1612
+ }
1613
+ saveMockData('Domains', 'postV2CustomersCustomerIdDomainsDomainTransferOut', 'default', data);
1614
+ done();
1615
+ } catch (err) {
1616
+ log.error(`Test Failure: ${err}`);
1617
+ done(err);
1618
+ }
1619
+ });
1620
+ } catch (error) {
1621
+ log.error(`Adapter Exception: ${error}`);
1622
+ done(error);
1623
+ }
1624
+ }).timeout(attemptTimeout);
1625
+ });
1626
+
1627
+ describe('#listDomains - errors', () => {
1628
+ it('should work if integrated or standalone with mockdata', (done) => {
1629
+ try {
1630
+ a.listDomains(null, null, null, null, null, null, (data, error) => {
1631
+ try {
1632
+ if (stub) {
1633
+ runCommonAsserts(data, error);
1634
+ assert.equal('object', typeof data.response[0]);
1635
+ assert.equal('object', typeof data.response[1]);
1636
+ } else {
1637
+ runCommonAsserts(data, error);
1638
+ }
1639
+ saveMockData('Domains', 'listDomains', 'default', data);
1640
+ done();
1641
+ } catch (err) {
1642
+ log.error(`Test Failure: ${err}`);
1643
+ done(err);
1644
+ }
1645
+ });
1646
+ } catch (error) {
1647
+ log.error(`Adapter Exception: ${error}`);
1648
+ done(error);
1649
+ }
1650
+ }).timeout(attemptTimeout);
1651
+ });
1652
+
1653
+ const domainsTlds = [];
1654
+ const domainsPrivacy = true;
1655
+ describe('#getAgreement - errors', () => {
1656
+ it('should work if integrated or standalone with mockdata', (done) => {
1657
+ try {
1658
+ a.getAgreement(domainsTlds, domainsPrivacy, null, (data, error) => {
1659
+ try {
1660
+ if (stub) {
1661
+ runCommonAsserts(data, error);
1662
+ assert.equal('object', typeof data.response[0]);
1663
+ } else {
1664
+ runCommonAsserts(data, error);
1665
+ }
1666
+ saveMockData('Domains', 'getAgreement', 'default', data);
1667
+ done();
1668
+ } catch (err) {
1669
+ log.error(`Test Failure: ${err}`);
1670
+ done(err);
1671
+ }
1672
+ });
1673
+ } catch (error) {
1674
+ log.error(`Adapter Exception: ${error}`);
1675
+ done(error);
1676
+ }
1677
+ }).timeout(attemptTimeout);
1678
+ });
1679
+
1680
+ describe('#available - errors', () => {
1681
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1682
+ try {
1683
+ a.available(domainsDomain, null, null, (data, error) => {
1684
+ try {
1685
+ if (stub) {
1686
+ const displayE = 'Error 400 received on request';
1687
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1688
+ } else {
1689
+ runCommonAsserts(data, error);
1690
+ }
1691
+ saveMockData('Domains', 'available', 'default', data);
1692
+ done();
1693
+ } catch (err) {
1694
+ log.error(`Test Failure: ${err}`);
1695
+ done(err);
1696
+ }
1697
+ });
1698
+ } catch (error) {
1699
+ log.error(`Adapter Exception: ${error}`);
1700
+ done(error);
1701
+ }
1702
+ }).timeout(attemptTimeout);
1703
+ });
1704
+
1705
+ const domainsTld = 'fakedata';
1706
+ describe('#schema - errors', () => {
1707
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1708
+ try {
1709
+ a.schema(domainsTld, (data, error) => {
1710
+ try {
1711
+ if (stub) {
1712
+ const displayE = 'Error 400 received on request';
1713
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1714
+ } else {
1715
+ runCommonAsserts(data, error);
1716
+ }
1717
+ saveMockData('Domains', 'schema', 'default', data);
1718
+ done();
1719
+ } catch (err) {
1720
+ log.error(`Test Failure: ${err}`);
1721
+ done(err);
1722
+ }
1723
+ });
1724
+ } catch (error) {
1725
+ log.error(`Adapter Exception: ${error}`);
1726
+ done(error);
1727
+ }
1728
+ }).timeout(attemptTimeout);
1729
+ });
1730
+
1731
+ describe('#suggest - errors', () => {
1732
+ it('should work if integrated or standalone with mockdata', (done) => {
1733
+ try {
1734
+ a.suggest(null, null, null, null, domainsTlds, null, null, null, null, (data, error) => {
1735
+ try {
1736
+ if (stub) {
1737
+ runCommonAsserts(data, error);
1738
+ assert.equal('object', typeof data.response[0]);
1739
+ assert.equal('object', typeof data.response[1]);
1740
+ assert.equal('object', typeof data.response[2]);
1741
+ } else {
1742
+ runCommonAsserts(data, error);
1743
+ }
1744
+ saveMockData('Domains', 'suggest', 'default', data);
1745
+ done();
1746
+ } catch (err) {
1747
+ log.error(`Test Failure: ${err}`);
1748
+ done(err);
1749
+ }
1750
+ });
1751
+ } catch (error) {
1752
+ log.error(`Adapter Exception: ${error}`);
1753
+ done(error);
1754
+ }
1755
+ }).timeout(attemptTimeout);
1756
+ });
1757
+
1758
+ describe('#tlds - errors', () => {
1759
+ it('should work if integrated or standalone with mockdata', (done) => {
1760
+ try {
1761
+ a.tlds((data, error) => {
1762
+ try {
1763
+ if (stub) {
1764
+ runCommonAsserts(data, error);
1765
+ assert.equal('object', typeof data.response[0]);
1766
+ assert.equal('object', typeof data.response[1]);
1767
+ assert.equal('object', typeof data.response[2]);
1768
+ } else {
1769
+ runCommonAsserts(data, error);
1770
+ }
1771
+ saveMockData('Domains', 'tlds', 'default', data);
1772
+ done();
1773
+ } catch (err) {
1774
+ log.error(`Test Failure: ${err}`);
1775
+ done(err);
1776
+ }
1777
+ });
1778
+ } catch (error) {
1779
+ log.error(`Adapter Exception: ${error}`);
1780
+ done(error);
1781
+ }
1782
+ }).timeout(attemptTimeout);
1783
+ });
1784
+
1785
+ const domainsUpdateBodyParam = {
1786
+ locked: false,
1787
+ nameServers: [
1788
+ null
1789
+ ],
1790
+ renewAuto: true,
1791
+ subaccountId: 'string',
1792
+ exposeWhois: false,
1793
+ consent: {
1794
+ agreedAt: 'string',
1795
+ agreedBy: 'string',
1796
+ agreementKeys: [
1797
+ 'EXPOSE_WHOIS'
1798
+ ]
1799
+ }
1800
+ };
1801
+ describe('#update - errors', () => {
1802
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1803
+ try {
1804
+ a.update(domainsDomain, domainsUpdateBodyParam, (data, error) => {
1805
+ try {
1806
+ if (stub) {
1807
+ const displayE = 'Error 400 received on request';
1808
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1809
+ } else {
1810
+ runCommonAsserts(data, error);
1811
+ }
1812
+ saveMockData('Domains', 'update', 'default', data);
1813
+ done();
1814
+ } catch (err) {
1815
+ log.error(`Test Failure: ${err}`);
1816
+ done(err);
1817
+ }
1818
+ });
1819
+ } catch (error) {
1820
+ log.error(`Adapter Exception: ${error}`);
1821
+ done(error);
1822
+ }
1823
+ }).timeout(attemptTimeout);
1824
+ });
1825
+
1826
+ describe('#getDomain - errors', () => {
1827
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1828
+ try {
1829
+ a.getDomain(domainsDomain, (data, error) => {
1830
+ try {
1831
+ if (stub) {
1832
+ const displayE = 'Error 400 received on request';
1833
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1834
+ } else {
1835
+ runCommonAsserts(data, error);
1836
+ }
1837
+ saveMockData('Domains', 'getDomain', 'default', data);
1838
+ done();
1839
+ } catch (err) {
1840
+ log.error(`Test Failure: ${err}`);
1841
+ done(err);
1842
+ }
1843
+ });
1844
+ } catch (error) {
1845
+ log.error(`Adapter Exception: ${error}`);
1846
+ done(error);
1847
+ }
1848
+ }).timeout(attemptTimeout);
1849
+ });
1850
+
1851
+ const domainsUpdateContactsBodyParam = {
1852
+ contactRegistrant: {}
1853
+ };
1854
+ describe('#updateContacts - errors', () => {
1855
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1856
+ try {
1857
+ a.updateContacts(domainsDomain, domainsUpdateContactsBodyParam, (data, error) => {
1858
+ try {
1859
+ if (stub) {
1860
+ const displayE = 'Error 400 received on request';
1861
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1862
+ } else {
1863
+ runCommonAsserts(data, error);
1864
+ }
1865
+ saveMockData('Domains', 'updateContacts', 'default', data);
1866
+ done();
1867
+ } catch (err) {
1868
+ log.error(`Test Failure: ${err}`);
1869
+ done(err);
1870
+ }
1871
+ });
1872
+ } catch (error) {
1873
+ log.error(`Adapter Exception: ${error}`);
1874
+ done(error);
1875
+ }
1876
+ }).timeout(attemptTimeout);
1877
+ });
1878
+
1879
+ const domainsRecordReplaceBodyParam = [
1880
+ {}
1881
+ ];
1882
+ describe('#recordReplace - errors', () => {
1883
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1884
+ try {
1885
+ a.recordReplace(domainsDomain, domainsRecordReplaceBodyParam, (data, error) => {
1886
+ try {
1887
+ if (stub) {
1888
+ const displayE = 'Error 400 received on request';
1889
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1890
+ } else {
1891
+ runCommonAsserts(data, error);
1892
+ }
1893
+ saveMockData('Domains', 'recordReplace', 'default', data);
1894
+ done();
1895
+ } catch (err) {
1896
+ log.error(`Test Failure: ${err}`);
1897
+ done(err);
1898
+ }
1899
+ });
1900
+ } catch (error) {
1901
+ log.error(`Adapter Exception: ${error}`);
1902
+ done(error);
1903
+ }
1904
+ }).timeout(attemptTimeout);
1905
+ });
1906
+
1907
+ const domainsRecordAddBodyParam = [
1908
+ {
1909
+ data: 'string',
1910
+ name: 'string',
1911
+ port: 7,
1912
+ priority: 10,
1913
+ protocol: 'string',
1914
+ service: 'string',
1915
+ ttl: 3,
1916
+ type: 'TXT',
1917
+ weight: 5
1918
+ }
1919
+ ];
1920
+ describe('#recordAdd - errors', () => {
1921
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1922
+ try {
1923
+ a.recordAdd(domainsDomain, domainsRecordAddBodyParam, (data, error) => {
1924
+ try {
1925
+ if (stub) {
1926
+ const displayE = 'Error 400 received on request';
1927
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1928
+ } else {
1929
+ runCommonAsserts(data, error);
1930
+ }
1931
+ saveMockData('Domains', 'recordAdd', 'default', data);
1932
+ done();
1933
+ } catch (err) {
1934
+ log.error(`Test Failure: ${err}`);
1935
+ done(err);
1936
+ }
1937
+ });
1938
+ } catch (error) {
1939
+ log.error(`Adapter Exception: ${error}`);
1940
+ done(error);
1941
+ }
1942
+ }).timeout(attemptTimeout);
1943
+ });
1944
+
1945
+ const domainsType = 'fakedata';
1946
+ const domainsRecordReplaceTypeBodyParam = [
1947
+ {}
1948
+ ];
1949
+ describe('#recordReplaceType - errors', () => {
1950
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1951
+ try {
1952
+ a.recordReplaceType(domainsDomain, domainsType, domainsRecordReplaceTypeBodyParam, (data, error) => {
1953
+ try {
1954
+ if (stub) {
1955
+ const displayE = 'Error 400 received on request';
1956
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1957
+ } else {
1958
+ runCommonAsserts(data, error);
1959
+ }
1960
+ saveMockData('Domains', 'recordReplaceType', 'default', data);
1961
+ done();
1962
+ } catch (err) {
1963
+ log.error(`Test Failure: ${err}`);
1964
+ done(err);
1965
+ }
1966
+ });
1967
+ } catch (error) {
1968
+ log.error(`Adapter Exception: ${error}`);
1969
+ done(error);
1970
+ }
1971
+ }).timeout(attemptTimeout);
1972
+ });
1973
+
1974
+ const domainsName = 'fakedata';
1975
+ const domainsRecordReplaceTypeNameBodyParam = [
1976
+ {}
1977
+ ];
1978
+ describe('#recordReplaceTypeName - errors', () => {
1979
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1980
+ try {
1981
+ a.recordReplaceTypeName(domainsDomain, domainsType, domainsName, domainsRecordReplaceTypeNameBodyParam, (data, error) => {
1982
+ try {
1983
+ if (stub) {
1984
+ const displayE = 'Error 400 received on request';
1985
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
1986
+ } else {
1987
+ runCommonAsserts(data, error);
1988
+ }
1989
+ saveMockData('Domains', 'recordReplaceTypeName', 'default', data);
1990
+ done();
1991
+ } catch (err) {
1992
+ log.error(`Test Failure: ${err}`);
1993
+ done(err);
1994
+ }
1995
+ });
1996
+ } catch (error) {
1997
+ log.error(`Adapter Exception: ${error}`);
1998
+ done(error);
1999
+ }
2000
+ }).timeout(attemptTimeout);
2001
+ });
2002
+
2003
+ describe('#recordGet - errors', () => {
2004
+ it('should work if integrated or standalone with mockdata', (done) => {
2005
+ try {
2006
+ a.recordGet(domainsDomain, domainsType, domainsName, null, null, (data, error) => {
2007
+ try {
2008
+ if (stub) {
2009
+ runCommonAsserts(data, error);
2010
+ assert.equal('object', typeof data.response[0]);
2011
+ assert.equal('object', typeof data.response[1]);
2012
+ } else {
2013
+ runCommonAsserts(data, error);
2014
+ }
2015
+ saveMockData('Domains', 'recordGet', 'default', data);
2016
+ done();
2017
+ } catch (err) {
2018
+ log.error(`Test Failure: ${err}`);
2019
+ done(err);
2020
+ }
2021
+ });
2022
+ } catch (error) {
2023
+ log.error(`Adapter Exception: ${error}`);
2024
+ done(error);
2025
+ }
2026
+ }).timeout(attemptTimeout);
2027
+ });
2028
+
2029
+ const domainsDomainsForwardsPutBodyParam = {
2030
+ type: 'REDIRECT_PERMANENT',
2031
+ url: 'string'
2032
+ };
2033
+ describe('#domainsForwardsPut - errors', () => {
2034
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2035
+ try {
2036
+ a.domainsForwardsPut(domainsCustomerId, domainsFqdn, domainsDomainsForwardsPutBodyParam, (data, error) => {
2037
+ try {
2038
+ if (stub) {
2039
+ const displayE = 'Error 400 received on request';
2040
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2041
+ } else {
2042
+ runCommonAsserts(data, error);
2043
+ }
2044
+ saveMockData('Domains', 'domainsForwardsPut', 'default', data);
2045
+ done();
2046
+ } catch (err) {
2047
+ log.error(`Test Failure: ${err}`);
2048
+ done(err);
2049
+ }
2050
+ });
2051
+ } catch (error) {
2052
+ log.error(`Adapter Exception: ${error}`);
2053
+ done(error);
2054
+ }
2055
+ }).timeout(attemptTimeout);
2056
+ });
2057
+
2058
+ describe('#domainsForwardsGet - errors', () => {
2059
+ it('should work if integrated or standalone with mockdata', (done) => {
2060
+ try {
2061
+ a.domainsForwardsGet(domainsCustomerId, domainsFqdn, null, (data, error) => {
2062
+ try {
2063
+ if (stub) {
2064
+ runCommonAsserts(data, error);
2065
+ assert.equal('object', typeof data.response[0]);
2066
+ } else {
2067
+ runCommonAsserts(data, error);
2068
+ }
2069
+ saveMockData('Domains', 'domainsForwardsGet', 'default', data);
2070
+ done();
2071
+ } catch (err) {
2072
+ log.error(`Test Failure: ${err}`);
2073
+ done(err);
2074
+ }
2075
+ });
2076
+ } catch (error) {
2077
+ log.error(`Adapter Exception: ${error}`);
2078
+ done(error);
2079
+ }
2080
+ }).timeout(attemptTimeout);
2081
+ });
2082
+
2083
+ describe('#getV2CustomersCustomerIdDomainsDomain - errors', () => {
2084
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2085
+ try {
2086
+ a.getV2CustomersCustomerIdDomainsDomain(domainsCustomerId, domainsDomain, null, (data, error) => {
2087
+ try {
2088
+ if (stub) {
2089
+ const displayE = 'Error 400 received on request';
2090
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2091
+ } else {
2092
+ runCommonAsserts(data, error);
2093
+ }
2094
+ saveMockData('Domains', 'getV2CustomersCustomerIdDomainsDomain', 'default', data);
2095
+ done();
2096
+ } catch (err) {
2097
+ log.error(`Test Failure: ${err}`);
2098
+ done(err);
2099
+ }
2100
+ });
2101
+ } catch (error) {
2102
+ log.error(`Adapter Exception: ${error}`);
2103
+ done(error);
2104
+ }
2105
+ }).timeout(attemptTimeout);
2106
+ });
2107
+
2108
+ describe('#getV2DomainsMaintenances - errors', () => {
2109
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2110
+ try {
2111
+ a.getV2DomainsMaintenances(null, null, null, null, (data, error) => {
2112
+ try {
2113
+ if (stub) {
2114
+ const displayE = 'Error 400 received on request';
2115
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2116
+ } else {
2117
+ runCommonAsserts(data, error);
2118
+ }
2119
+ saveMockData('Domains', 'getV2DomainsMaintenances', 'default', data);
2120
+ done();
2121
+ } catch (err) {
2122
+ log.error(`Test Failure: ${err}`);
2123
+ done(err);
2124
+ }
2125
+ });
2126
+ } catch (error) {
2127
+ log.error(`Adapter Exception: ${error}`);
2128
+ done(error);
2129
+ }
2130
+ }).timeout(attemptTimeout);
2131
+ });
2132
+
2133
+ const domainsMaintenanceId = 'fakedata';
2134
+ describe('#getV2DomainsMaintenancesMaintenanceId - errors', () => {
2135
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2136
+ try {
2137
+ a.getV2DomainsMaintenancesMaintenanceId(domainsMaintenanceId, (data, error) => {
2138
+ try {
2139
+ if (stub) {
2140
+ const displayE = 'Error 400 received on request';
2141
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2142
+ } else {
2143
+ runCommonAsserts(data, error);
2144
+ }
2145
+ saveMockData('Domains', 'getV2DomainsMaintenancesMaintenanceId', 'default', data);
2146
+ done();
2147
+ } catch (err) {
2148
+ log.error(`Test Failure: ${err}`);
2149
+ done(err);
2150
+ }
2151
+ });
2152
+ } catch (error) {
2153
+ log.error(`Adapter Exception: ${error}`);
2154
+ done(error);
2155
+ }
2156
+ }).timeout(attemptTimeout);
2157
+ });
2158
+
2159
+ const actionsCustomerId = 'fakedata';
2160
+ const actionsDomain = 'fakedata';
2161
+ describe('#getV2CustomersCustomerIdDomainsDomainActions - errors', () => {
2162
+ it('should work if integrated or standalone with mockdata', (done) => {
2163
+ try {
2164
+ a.getV2CustomersCustomerIdDomainsDomainActions(actionsCustomerId, actionsDomain, (data, error) => {
2165
+ try {
2166
+ if (stub) {
2167
+ runCommonAsserts(data, error);
2168
+ assert.equal('object', typeof data.response[0]);
2169
+ assert.equal('object', typeof data.response[1]);
2170
+ assert.equal('object', typeof data.response[2]);
2171
+ assert.equal('object', typeof data.response[3]);
2172
+ } else {
2173
+ runCommonAsserts(data, error);
2174
+ }
2175
+ saveMockData('Actions', 'getV2CustomersCustomerIdDomainsDomainActions', 'default', data);
2176
+ done();
2177
+ } catch (err) {
2178
+ log.error(`Test Failure: ${err}`);
2179
+ done(err);
2180
+ }
2181
+ });
2182
+ } catch (error) {
2183
+ log.error(`Adapter Exception: ${error}`);
2184
+ done(error);
2185
+ }
2186
+ }).timeout(attemptTimeout);
2187
+ });
2188
+
2189
+ const actionsType = 'fakedata';
2190
+ describe('#getV2CustomersCustomerIdDomainsDomainActionsType - errors', () => {
2191
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2192
+ try {
2193
+ a.getV2CustomersCustomerIdDomainsDomainActionsType(actionsCustomerId, actionsDomain, actionsType, (data, error) => {
2194
+ try {
2195
+ if (stub) {
2196
+ const displayE = 'Error 400 received on request';
2197
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2198
+ } else {
2199
+ runCommonAsserts(data, error);
2200
+ }
2201
+ saveMockData('Actions', 'getV2CustomersCustomerIdDomainsDomainActionsType', 'default', data);
2202
+ done();
2203
+ } catch (err) {
2204
+ log.error(`Test Failure: ${err}`);
2205
+ done(err);
2206
+ }
2207
+ });
2208
+ } catch (error) {
2209
+ log.error(`Adapter Exception: ${error}`);
2210
+ done(error);
2211
+ }
2212
+ }).timeout(attemptTimeout);
2213
+ });
2214
+
2215
+ const notificationsCustomerId = 'fakedata';
2216
+ const notificationsNotificationId = 'fakedata';
2217
+ describe('#postV2CustomersCustomerIdDomainsNotificationsNotificationIdAcknowledge - errors', () => {
2218
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2219
+ try {
2220
+ a.postV2CustomersCustomerIdDomainsNotificationsNotificationIdAcknowledge(notificationsCustomerId, notificationsNotificationId, (data, error) => {
2221
+ try {
2222
+ if (stub) {
2223
+ const displayE = 'Error 400 received on request';
2224
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2225
+ } else {
2226
+ runCommonAsserts(data, error);
2227
+ }
2228
+ saveMockData('Notifications', 'postV2CustomersCustomerIdDomainsNotificationsNotificationIdAcknowledge', 'default', data);
2229
+ done();
2230
+ } catch (err) {
2231
+ log.error(`Test Failure: ${err}`);
2232
+ done(err);
2233
+ }
2234
+ });
2235
+ } catch (error) {
2236
+ log.error(`Adapter Exception: ${error}`);
2237
+ done(error);
2238
+ }
2239
+ }).timeout(attemptTimeout);
2240
+ });
2241
+
2242
+ describe('#getV2CustomersCustomerIdDomainsNotifications - errors', () => {
2243
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2244
+ try {
2245
+ a.getV2CustomersCustomerIdDomainsNotifications(notificationsCustomerId, (data, error) => {
2246
+ try {
2247
+ if (stub) {
2248
+ const displayE = 'Error 400 received on request';
2249
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2250
+ } else {
2251
+ runCommonAsserts(data, error);
2252
+ }
2253
+ saveMockData('Notifications', 'getV2CustomersCustomerIdDomainsNotifications', 'default', data);
2254
+ done();
2255
+ } catch (err) {
2256
+ log.error(`Test Failure: ${err}`);
2257
+ done(err);
2258
+ }
2259
+ });
2260
+ } catch (error) {
2261
+ log.error(`Adapter Exception: ${error}`);
2262
+ done(error);
2263
+ }
2264
+ }).timeout(attemptTimeout);
2265
+ });
2266
+
2267
+ const notificationsTypes = [];
2268
+ describe('#putV2CustomersCustomerIdDomainsNotificationsOptIn - errors', () => {
2269
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2270
+ try {
2271
+ a.putV2CustomersCustomerIdDomainsNotificationsOptIn(notificationsCustomerId, notificationsTypes, (data, error) => {
2272
+ try {
2273
+ if (stub) {
2274
+ const displayE = 'Error 400 received on request';
2275
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2276
+ } else {
2277
+ runCommonAsserts(data, error);
2278
+ }
2279
+ saveMockData('Notifications', 'putV2CustomersCustomerIdDomainsNotificationsOptIn', 'default', data);
2280
+ done();
2281
+ } catch (err) {
2282
+ log.error(`Test Failure: ${err}`);
2283
+ done(err);
2284
+ }
2285
+ });
2286
+ } catch (error) {
2287
+ log.error(`Adapter Exception: ${error}`);
2288
+ done(error);
2289
+ }
2290
+ }).timeout(attemptTimeout);
2291
+ });
2292
+
2293
+ describe('#getV2CustomersCustomerIdDomainsNotificationsOptIn - errors', () => {
2294
+ it('should work if integrated or standalone with mockdata', (done) => {
2295
+ try {
2296
+ a.getV2CustomersCustomerIdDomainsNotificationsOptIn(notificationsCustomerId, (data, error) => {
2297
+ try {
2298
+ if (stub) {
2299
+ runCommonAsserts(data, error);
2300
+ assert.equal('object', typeof data.response[0]);
2301
+ assert.equal('object', typeof data.response[1]);
2302
+ assert.equal('object', typeof data.response[2]);
2303
+ } else {
2304
+ runCommonAsserts(data, error);
2305
+ }
2306
+ saveMockData('Notifications', 'getV2CustomersCustomerIdDomainsNotificationsOptIn', 'default', data);
2307
+ done();
2308
+ } catch (err) {
2309
+ log.error(`Test Failure: ${err}`);
2310
+ done(err);
2311
+ }
2312
+ });
2313
+ } catch (error) {
2314
+ log.error(`Adapter Exception: ${error}`);
2315
+ done(error);
2316
+ }
2317
+ }).timeout(attemptTimeout);
2318
+ });
2319
+
2320
+ const notificationsType = 'fakedata';
2321
+ describe('#getV2CustomersCustomerIdDomainsNotificationsSchemasType - errors', () => {
2322
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2323
+ try {
2324
+ a.getV2CustomersCustomerIdDomainsNotificationsSchemasType(notificationsCustomerId, notificationsType, (data, error) => {
2325
+ try {
2326
+ if (stub) {
2327
+ const displayE = 'Error 400 received on request';
2328
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2329
+ } else {
2330
+ runCommonAsserts(data, error);
2331
+ }
2332
+ saveMockData('Notifications', 'getV2CustomersCustomerIdDomainsNotificationsSchemasType', 'default', data);
2333
+ done();
2334
+ } catch (err) {
2335
+ log.error(`Test Failure: ${err}`);
2336
+ done(err);
2337
+ }
2338
+ });
2339
+ } catch (error) {
2340
+ log.error(`Adapter Exception: ${error}`);
2341
+ done(error);
2342
+ }
2343
+ }).timeout(attemptTimeout);
2344
+ });
2345
+
2346
+ describe('#listOrders - errors', () => {
2347
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2348
+ try {
2349
+ a.listOrders(null, null, null, null, null, null, null, null, null, (data, error) => {
2350
+ try {
2351
+ if (stub) {
2352
+ const displayE = 'Error 400 received on request';
2353
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2354
+ } else {
2355
+ runCommonAsserts(data, error);
2356
+ }
2357
+ saveMockData('Orders', 'listOrders', 'default', data);
2358
+ done();
2359
+ } catch (err) {
2360
+ log.error(`Test Failure: ${err}`);
2361
+ done(err);
2362
+ }
2363
+ });
2364
+ } catch (error) {
2365
+ log.error(`Adapter Exception: ${error}`);
2366
+ done(error);
2367
+ }
2368
+ }).timeout(attemptTimeout);
2369
+ });
2370
+
2371
+ const ordersOrderId = 'fakedata';
2372
+ describe('#get - errors', () => {
2373
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2374
+ try {
2375
+ a.get(ordersOrderId, (data, error) => {
2376
+ try {
2377
+ if (stub) {
2378
+ const displayE = 'Error 400 received on request';
2379
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2380
+ } else {
2381
+ runCommonAsserts(data, error);
2382
+ }
2383
+ saveMockData('Orders', 'get', 'default', data);
2384
+ done();
2385
+ } catch (err) {
2386
+ log.error(`Test Failure: ${err}`);
2387
+ done(err);
2388
+ }
2389
+ });
2390
+ } catch (error) {
2391
+ log.error(`Adapter Exception: ${error}`);
2392
+ done(error);
2393
+ }
2394
+ }).timeout(attemptTimeout);
2395
+ });
2396
+
2397
+ const parkingCustomerId = 'fakedata';
2398
+ describe('#getMetrics - errors', () => {
2399
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2400
+ try {
2401
+ a.getMetrics(parkingCustomerId, null, null, null, null, (data, error) => {
2402
+ try {
2403
+ if (stub) {
2404
+ const displayE = 'Error 400 received on request';
2405
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2406
+ } else {
2407
+ runCommonAsserts(data, error);
2408
+ }
2409
+ saveMockData('Parking', 'getMetrics', 'default', data);
2410
+ done();
2411
+ } catch (err) {
2412
+ log.error(`Test Failure: ${err}`);
2413
+ done(err);
2414
+ }
2415
+ });
2416
+ } catch (error) {
2417
+ log.error(`Adapter Exception: ${error}`);
2418
+ done(error);
2419
+ }
2420
+ }).timeout(attemptTimeout);
2421
+ });
2422
+
2423
+ const parkingStartDate = 'fakedata';
2424
+ const parkingEndDate = 'fakedata';
2425
+ describe('#getMetricsByDomain - errors', () => {
2426
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2427
+ try {
2428
+ a.getMetricsByDomain(parkingCustomerId, parkingStartDate, parkingEndDate, null, null, null, null, null, (data, error) => {
2429
+ try {
2430
+ if (stub) {
2431
+ const displayE = 'Error 400 received on request';
2432
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2433
+ } else {
2434
+ runCommonAsserts(data, error);
2435
+ }
2436
+ saveMockData('Parking', 'getMetricsByDomain', 'default', data);
2437
+ done();
2438
+ } catch (err) {
2439
+ log.error(`Test Failure: ${err}`);
2440
+ done(err);
2441
+ }
2442
+ });
2443
+ } catch (error) {
2444
+ log.error(`Adapter Exception: ${error}`);
2445
+ done(error);
2446
+ }
2447
+ }).timeout(attemptTimeout);
2448
+ });
2449
+
2450
+ const shoppersCreateSubaccountBodyParam = {
2451
+ email: 'string',
2452
+ nameFirst: 'string',
2453
+ nameLast: 'string',
2454
+ password: 'string'
2455
+ };
2456
+ describe('#createSubaccount - errors', () => {
2457
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2458
+ try {
2459
+ a.createSubaccount(shoppersCreateSubaccountBodyParam, (data, error) => {
2460
+ try {
2461
+ if (stub) {
2462
+ const displayE = 'Error 400 received on request';
2463
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2464
+ } else {
2465
+ runCommonAsserts(data, error);
2466
+ }
2467
+ saveMockData('Shoppers', 'createSubaccount', 'default', data);
2468
+ done();
2469
+ } catch (err) {
2470
+ log.error(`Test Failure: ${err}`);
2471
+ done(err);
2472
+ }
2473
+ });
2474
+ } catch (error) {
2475
+ log.error(`Adapter Exception: ${error}`);
2476
+ done(error);
2477
+ }
2478
+ }).timeout(attemptTimeout);
2479
+ });
2480
+
2481
+ const shoppersShopperId = 'fakedata';
2482
+ const shoppersUpdateShopperBodyParam = {
2483
+ email: 'string',
2484
+ externalId: 7,
2485
+ marketId: 'vi-VN',
2486
+ nameFirst: 'string',
2487
+ nameLast: 'string'
2488
+ };
2489
+ describe('#updateShopper - errors', () => {
2490
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2491
+ try {
2492
+ a.updateShopper(shoppersShopperId, shoppersUpdateShopperBodyParam, (data, error) => {
2493
+ try {
2494
+ if (stub) {
2495
+ const displayE = 'Error 400 received on request';
2496
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2497
+ } else {
2498
+ runCommonAsserts(data, error);
2499
+ }
2500
+ saveMockData('Shoppers', 'updateShopper', 'default', data);
2501
+ done();
2502
+ } catch (err) {
2503
+ log.error(`Test Failure: ${err}`);
2504
+ done(err);
2505
+ }
2506
+ });
2507
+ } catch (error) {
2508
+ log.error(`Adapter Exception: ${error}`);
2509
+ done(error);
2510
+ }
2511
+ }).timeout(attemptTimeout);
2512
+ });
2513
+
2514
+ describe('#getShopper - errors', () => {
2515
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2516
+ try {
2517
+ a.getShopper(shoppersShopperId, null, (data, error) => {
2518
+ try {
2519
+ if (stub) {
2520
+ const displayE = 'Error 400 received on request';
2521
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2522
+ } else {
2523
+ runCommonAsserts(data, error);
2524
+ }
2525
+ saveMockData('Shoppers', 'getShopper', 'default', data);
2526
+ done();
2527
+ } catch (err) {
2528
+ log.error(`Test Failure: ${err}`);
2529
+ done(err);
2530
+ }
2531
+ });
2532
+ } catch (error) {
2533
+ log.error(`Adapter Exception: ${error}`);
2534
+ done(error);
2535
+ }
2536
+ }).timeout(attemptTimeout);
2537
+ });
2538
+
2539
+ const shoppersChangePasswordBodyParam = {
2540
+ secret: 'P@55w0rd+'
2541
+ };
2542
+ describe('#changePassword - errors', () => {
2543
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2544
+ try {
2545
+ a.changePassword(shoppersShopperId, shoppersChangePasswordBodyParam, (data, error) => {
2546
+ try {
2547
+ if (stub) {
2548
+ const displayE = 'Error 400 received on request';
2549
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2550
+ } else {
2551
+ runCommonAsserts(data, error);
2552
+ }
2553
+ saveMockData('Shoppers', 'changePassword', 'default', data);
2554
+ done();
2555
+ } catch (err) {
2556
+ log.error(`Test Failure: ${err}`);
2557
+ done(err);
2558
+ }
2559
+ });
2560
+ } catch (error) {
2561
+ log.error(`Adapter Exception: ${error}`);
2562
+ done(error);
2563
+ }
2564
+ }).timeout(attemptTimeout);
2565
+ });
2566
+
2567
+ const shoppersAuditClientIp = 'fakedata';
2568
+ describe('#getStatus - errors', () => {
2569
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2570
+ try {
2571
+ a.getStatus(shoppersShopperId, shoppersAuditClientIp, (data, error) => {
2572
+ try {
2573
+ if (stub) {
2574
+ const displayE = 'Error 400 received on request';
2575
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2576
+ } else {
2577
+ runCommonAsserts(data, error);
2578
+ }
2579
+ saveMockData('Shoppers', 'getStatus', 'default', data);
2580
+ done();
2581
+ } catch (err) {
2582
+ log.error(`Test Failure: ${err}`);
2583
+ done(err);
2584
+ }
2585
+ });
2586
+ } catch (error) {
2587
+ log.error(`Adapter Exception: ${error}`);
2588
+ done(error);
2589
+ }
2590
+ }).timeout(attemptTimeout);
2591
+ });
2592
+
2593
+ describe('#list - errors', () => {
2594
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2595
+ try {
2596
+ a.list(null, null, null, null, null, (data, error) => {
2597
+ try {
2598
+ if (stub) {
2599
+ const displayE = 'Error 400 received on request';
2600
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2601
+ } else {
2602
+ runCommonAsserts(data, error);
2603
+ }
2604
+ saveMockData('Subscriptions', 'list', 'default', data);
2605
+ done();
2606
+ } catch (err) {
2607
+ log.error(`Test Failure: ${err}`);
2608
+ done(err);
2609
+ }
2610
+ });
2611
+ } catch (error) {
2612
+ log.error(`Adapter Exception: ${error}`);
2613
+ done(error);
2614
+ }
2615
+ }).timeout(attemptTimeout);
2616
+ });
2617
+
2618
+ describe('#productGroups - errors', () => {
2619
+ it('should work if integrated or standalone with mockdata', (done) => {
2620
+ try {
2621
+ a.productGroups((data, error) => {
2622
+ try {
2623
+ if (stub) {
2624
+ runCommonAsserts(data, error);
2625
+ assert.equal('object', typeof data.response[0]);
2626
+ assert.equal('object', typeof data.response[1]);
2627
+ } else {
2628
+ runCommonAsserts(data, error);
2629
+ }
2630
+ saveMockData('Subscriptions', 'productGroups', 'default', data);
2631
+ done();
2632
+ } catch (err) {
2633
+ log.error(`Test Failure: ${err}`);
2634
+ done(err);
2635
+ }
2636
+ });
2637
+ } catch (error) {
2638
+ log.error(`Adapter Exception: ${error}`);
2639
+ done(error);
2640
+ }
2641
+ }).timeout(attemptTimeout);
2642
+ });
2643
+
2644
+ const subscriptionsSubscriptionId = 'fakedata';
2645
+ const subscriptionsUpdateSubscriptionBodyParam = {
2646
+ paymentProfileId: 9,
2647
+ renewAuto: true
2648
+ };
2649
+ describe('#updateSubscription - errors', () => {
2650
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2651
+ try {
2652
+ a.updateSubscription(subscriptionsSubscriptionId, subscriptionsUpdateSubscriptionBodyParam, (data, error) => {
2653
+ try {
2654
+ if (stub) {
2655
+ const displayE = 'Error 400 received on request';
2656
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2657
+ } else {
2658
+ runCommonAsserts(data, error);
2659
+ }
2660
+ saveMockData('Subscriptions', 'updateSubscription', 'default', data);
2661
+ done();
2662
+ } catch (err) {
2663
+ log.error(`Test Failure: ${err}`);
2664
+ done(err);
2665
+ }
2666
+ });
2667
+ } catch (error) {
2668
+ log.error(`Adapter Exception: ${error}`);
2669
+ done(error);
2670
+ }
2671
+ }).timeout(attemptTimeout);
2672
+ });
2673
+
2674
+ describe('#getSubscription - errors', () => {
2675
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2676
+ try {
2677
+ a.getSubscription(subscriptionsSubscriptionId, (data, error) => {
2678
+ try {
2679
+ if (stub) {
2680
+ const displayE = 'Error 400 received on request';
2681
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2682
+ } else {
2683
+ runCommonAsserts(data, error);
2684
+ }
2685
+ saveMockData('Subscriptions', 'getSubscription', 'default', data);
2686
+ done();
2687
+ } catch (err) {
2688
+ log.error(`Test Failure: ${err}`);
2689
+ done(err);
2690
+ }
2691
+ });
2692
+ } catch (error) {
2693
+ log.error(`Adapter Exception: ${error}`);
2694
+ done(error);
2695
+ }
2696
+ }).timeout(attemptTimeout);
2697
+ });
2698
+
2699
+ const aftermarketDomains = [];
2700
+ describe('#deleteListings - errors', () => {
2701
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2702
+ try {
2703
+ a.deleteListings(aftermarketDomains, (data, error) => {
2704
+ try {
2705
+ if (stub) {
2706
+ const displayE = 'Error 400 received on request';
2707
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2708
+ } else {
2709
+ runCommonAsserts(data, error);
2710
+ }
2711
+ saveMockData('Aftermarket', 'deleteListings', 'default', data);
2712
+ done();
2713
+ } catch (err) {
2714
+ log.error(`Test Failure: ${err}`);
2715
+ done(err);
2716
+ }
2717
+ });
2718
+ } catch (error) {
2719
+ log.error(`Adapter Exception: ${error}`);
2720
+ done(error);
2721
+ }
2722
+ }).timeout(attemptTimeout);
2723
+ });
2724
+
2725
+ describe('#certificateCallbackDelete - errors', () => {
2726
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2727
+ try {
2728
+ a.certificateCallbackDelete(certificateCertificateId, (data, error) => {
2729
+ try {
2730
+ if (stub) {
2731
+ const displayE = 'Error 400 received on request';
2732
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2733
+ } else {
2734
+ runCommonAsserts(data, error);
2735
+ }
2736
+ saveMockData('Certificate', 'certificateCallbackDelete', 'default', data);
2737
+ done();
2738
+ } catch (err) {
2739
+ log.error(`Test Failure: ${err}`);
2740
+ done(err);
2741
+ }
2742
+ });
2743
+ } catch (error) {
2744
+ log.error(`Adapter Exception: ${error}`);
2745
+ done(error);
2746
+ }
2747
+ }).timeout(attemptTimeout);
2748
+ });
2749
+
2750
+ describe('#cancel - errors', () => {
2751
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2752
+ try {
2753
+ a.cancel(domainsDomain, (data, error) => {
2754
+ try {
2755
+ if (stub) {
2756
+ const displayE = 'Error 400 received on request';
2757
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2758
+ } else {
2759
+ runCommonAsserts(data, error);
2760
+ }
2761
+ saveMockData('Domains', 'cancel', 'default', data);
2762
+ done();
2763
+ } catch (err) {
2764
+ log.error(`Test Failure: ${err}`);
2765
+ done(err);
2766
+ }
2767
+ });
2768
+ } catch (error) {
2769
+ log.error(`Adapter Exception: ${error}`);
2770
+ done(error);
2771
+ }
2772
+ }).timeout(attemptTimeout);
2773
+ });
2774
+
2775
+ describe('#cancelPrivacy - errors', () => {
2776
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2777
+ try {
2778
+ a.cancelPrivacy(domainsDomain, (data, error) => {
2779
+ try {
2780
+ if (stub) {
2781
+ const displayE = 'Error 400 received on request';
2782
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2783
+ } else {
2784
+ runCommonAsserts(data, error);
2785
+ }
2786
+ saveMockData('Domains', 'cancelPrivacy', 'default', data);
2787
+ done();
2788
+ } catch (err) {
2789
+ log.error(`Test Failure: ${err}`);
2790
+ done(err);
2791
+ }
2792
+ });
2793
+ } catch (error) {
2794
+ log.error(`Adapter Exception: ${error}`);
2795
+ done(error);
2796
+ }
2797
+ }).timeout(attemptTimeout);
2798
+ });
2799
+
2800
+ describe('#recordDeleteTypeName - errors', () => {
2801
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2802
+ try {
2803
+ a.recordDeleteTypeName(domainsDomain, domainsType, domainsName, (data, error) => {
2804
+ try {
2805
+ if (stub) {
2806
+ const displayE = 'Error 400 received on request';
2807
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2808
+ } else {
2809
+ runCommonAsserts(data, error);
2810
+ }
2811
+ saveMockData('Domains', 'recordDeleteTypeName', 'default', data);
2812
+ done();
2813
+ } catch (err) {
2814
+ log.error(`Test Failure: ${err}`);
2815
+ done(err);
2816
+ }
2817
+ });
2818
+ } catch (error) {
2819
+ log.error(`Adapter Exception: ${error}`);
2820
+ done(error);
2821
+ }
2822
+ }).timeout(attemptTimeout);
2823
+ });
2824
+
2825
+ describe('#domainsForwardsDelete - errors', () => {
2826
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2827
+ try {
2828
+ a.domainsForwardsDelete(domainsCustomerId, domainsFqdn, (data, error) => {
2829
+ try {
2830
+ if (stub) {
2831
+ const displayE = 'Error 400 received on request';
2832
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2833
+ } else {
2834
+ runCommonAsserts(data, error);
2835
+ }
2836
+ saveMockData('Domains', 'domainsForwardsDelete', 'default', data);
2837
+ done();
2838
+ } catch (err) {
2839
+ log.error(`Test Failure: ${err}`);
2840
+ done(err);
2841
+ }
2842
+ });
2843
+ } catch (error) {
2844
+ log.error(`Adapter Exception: ${error}`);
2845
+ done(error);
2846
+ }
2847
+ }).timeout(attemptTimeout);
2848
+ });
2849
+
2850
+ describe('#deleteV2CustomersCustomerIdDomainsDomainActionsType - errors', () => {
2851
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2852
+ try {
2853
+ a.deleteV2CustomersCustomerIdDomainsDomainActionsType(actionsCustomerId, actionsDomain, actionsType, (data, error) => {
2854
+ try {
2855
+ if (stub) {
2856
+ const displayE = 'Error 400 received on request';
2857
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2858
+ } else {
2859
+ runCommonAsserts(data, error);
2860
+ }
2861
+ saveMockData('Actions', 'deleteV2CustomersCustomerIdDomainsDomainActionsType', 'default', data);
2862
+ done();
2863
+ } catch (err) {
2864
+ log.error(`Test Failure: ${err}`);
2865
+ done(err);
2866
+ }
2867
+ });
2868
+ } catch (error) {
2869
+ log.error(`Adapter Exception: ${error}`);
2870
+ done(error);
2871
+ }
2872
+ }).timeout(attemptTimeout);
2873
+ });
2874
+
2875
+ describe('#delete - errors', () => {
2876
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2877
+ try {
2878
+ a.delete(shoppersShopperId, shoppersAuditClientIp, (data, error) => {
2879
+ try {
2880
+ if (stub) {
2881
+ const displayE = 'Error 400 received on request';
2882
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2883
+ } else {
2884
+ runCommonAsserts(data, error);
2885
+ }
2886
+ saveMockData('Shoppers', 'delete', 'default', data);
2887
+ done();
2888
+ } catch (err) {
2889
+ log.error(`Test Failure: ${err}`);
2890
+ done(err);
2891
+ }
2892
+ });
2893
+ } catch (error) {
2894
+ log.error(`Adapter Exception: ${error}`);
2895
+ done(error);
2896
+ }
2897
+ }).timeout(attemptTimeout);
2898
+ });
2899
+
2900
+ describe('#cancelSubscription - errors', () => {
2901
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2902
+ try {
2903
+ a.cancelSubscription(subscriptionsSubscriptionId, (data, error) => {
2904
+ try {
2905
+ if (stub) {
2906
+ const displayE = 'Error 400 received on request';
2907
+ runErrorAsserts(data, error, 'AD.500', 'Test-godaddy-connectorRest-handleEndResponse', displayE);
2908
+ } else {
2909
+ runCommonAsserts(data, error);
2910
+ }
2911
+ saveMockData('Subscriptions', 'cancelSubscription', 'default', data);
2912
+ done();
2913
+ } catch (err) {
2914
+ log.error(`Test Failure: ${err}`);
2915
+ done(err);
2916
+ }
2917
+ });
2918
+ } catch (error) {
2919
+ log.error(`Adapter Exception: ${error}`);
2920
+ done(error);
2921
+ }
2922
+ }).timeout(attemptTimeout);
2923
+ });
2924
+ });
2925
+ });