@itentialopensource/adapter-google_drive 0.1.1 → 0.3.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.
@@ -3,6 +3,8 @@
3
3
  // Set globals
4
4
  /* global describe it log pronghornProps */
5
5
  /* eslint no-unused-vars: warn */
6
+ /* eslint no-underscore-dangle: warn */
7
+ /* eslint import/no-dynamic-require:warn */
6
8
 
7
9
  // include required items for testing & logging
8
10
  const assert = require('assert');
@@ -14,27 +16,38 @@ const { expect } = require('chai');
14
16
  const { use } = require('chai');
15
17
  const td = require('testdouble');
16
18
  const util = require('util');
17
- const pronghorn = require('../../pronghorn.json');
18
19
 
19
- pronghorn.methodsByName = pronghorn.methods.reduce((result, meth) => ({ ...result, [meth.name]: meth }), {});
20
20
  const anything = td.matchers.anything();
21
21
 
22
22
  // stub and attemptTimeout are used throughout the code so set them here
23
23
  let logLevel = 'none';
24
- const stub = true;
25
24
  const isRapidFail = false;
26
25
  const isSaveMockData = false;
27
- const attemptTimeout = 5000;
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;
28
35
 
29
36
  // these variables can be changed to run in integrated mode so easier to set them here
30
37
  // always check these in with bogus data!!!
31
- const host = 'replace.hostorip.here';
32
- const username = 'username';
33
- const password = 'password';
34
- const protocol = 'http';
35
- const port = 80;
36
- const sslenable = false;
37
- const sslinvalid = false;
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;
38
51
 
39
52
  // these are the adapter properties. You generally should not need to alter
40
53
  // any of these after they are initially set up
@@ -46,102 +59,7 @@ global.pronghornProps = {
46
59
  adapters: [{
47
60
  id: 'Test-google_drive',
48
61
  type: 'GoogleDrive',
49
- properties: {
50
- host,
51
- port,
52
- base_path: '/drive/v3',
53
- version: '',
54
- cache_location: 'none',
55
- encode_pathvars: true,
56
- save_metric: false,
57
- stub,
58
- protocol,
59
- authentication: {
60
- auth_method: 'no_authentication',
61
- username,
62
- password,
63
- token: '',
64
- invalid_token_error: 401,
65
- token_timeout: -1,
66
- token_cache: 'local',
67
- auth_field: 'header.headers.Authorization',
68
- auth_field_format: 'Bearer {token}',
69
- auth_logging: false,
70
- client_id: '',
71
- client_secret: '',
72
- grant_type: ''
73
- },
74
- healthcheck: {
75
- type: 'intermittent',
76
- frequency: 600000,
77
- query_object: {}
78
- },
79
- throttle: {
80
- throttle_enabled: false,
81
- number_pronghorns: 1,
82
- sync_async: 'sync',
83
- max_in_queue: 1000,
84
- concurrent_max: 1,
85
- expire_timeout: 0,
86
- avg_runtime: 200,
87
- priorities: [
88
- {
89
- value: 0,
90
- percent: 100
91
- }
92
- ]
93
- },
94
- request: {
95
- number_redirects: 0,
96
- number_retries: 3,
97
- limit_retry_error: [0],
98
- failover_codes: [],
99
- attempt_timeout: attemptTimeout,
100
- global_request: {
101
- payload: {},
102
- uriOptions: {},
103
- addlHeaders: {},
104
- authData: {}
105
- },
106
- healthcheck_on_timeout: true,
107
- return_raw: true,
108
- archiving: false,
109
- return_request: false
110
- },
111
- proxy: {
112
- enabled: false,
113
- host: '',
114
- port: 1,
115
- protocol: 'http',
116
- username: '',
117
- password: ''
118
- },
119
- ssl: {
120
- ecdhCurve: '',
121
- enabled: sslenable,
122
- accept_invalid_cert: sslinvalid,
123
- ca_file: '',
124
- key_file: '',
125
- cert_file: '',
126
- secure_protocol: '',
127
- ciphers: ''
128
- },
129
- mongo: {
130
- host: '',
131
- port: 0,
132
- database: '',
133
- username: '',
134
- password: '',
135
- replSet: '',
136
- db_ssl: {
137
- enabled: false,
138
- accept_invalid_cert: false,
139
- ca_file: '',
140
- key_file: '',
141
- cert_file: ''
142
- }
143
- }
144
- }
62
+ properties: samProps
145
63
  }]
146
64
  }
147
65
  };
@@ -425,36 +343,28 @@ describe('[integration] Google_drive Adapter Test', () => {
425
343
  -----------------------------------------------------------------------
426
344
  -----------------------------------------------------------------------
427
345
  */
428
- let skipCount = 0;
429
-
430
346
  describe('#driveAboutGet - errors', () => {
431
347
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
432
- if (pronghorn.methodsByName.driveAboutGet.task) {
433
- try {
434
- a.driveAboutGet(null, null, null, null, null, null, null, (data, error) => {
435
- try {
436
- if (stub) {
437
- const displayE = 'Error 400 received on request';
438
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
439
- } else {
440
- runCommonAsserts(data, error);
441
- }
442
- saveMockData('About', 'driveAboutGet', 'default', data);
443
- done();
444
- } catch (err) {
445
- log.error(`Test Failure: ${err}`);
446
- done(err);
348
+ try {
349
+ a.driveAboutGet(null, null, null, null, null, null, null, (data, error) => {
350
+ try {
351
+ if (stub) {
352
+ const displayE = 'Error 400 received on request';
353
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
354
+ } else {
355
+ runCommonAsserts(data, error);
447
356
  }
448
- });
449
- } catch (error) {
450
- log.error(`Adapter Exception: ${error}`);
451
- done(error);
452
- }
453
- } else {
454
- log.error('driveAboutGet task is false, skipping test');
455
- skipCount += 1;
456
- done();
457
- }// end if task
357
+ saveMockData('About', 'driveAboutGet', 'default', data);
358
+ done();
359
+ } catch (err) {
360
+ log.error(`Test Failure: ${err}`);
361
+ done(err);
362
+ }
363
+ });
364
+ } catch (error) {
365
+ log.error(`Adapter Exception: ${error}`);
366
+ done(error);
367
+ }
458
368
  }).timeout(attemptTimeout);
459
369
  });
460
370
 
@@ -473,94 +383,76 @@ describe('[integration] Google_drive Adapter Test', () => {
473
383
  };
474
384
  describe('#driveChangesWatch - errors', () => {
475
385
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
476
- if (pronghorn.methodsByName.driveChangesWatch.task) {
477
- try {
478
- a.driveChangesWatch(null, null, null, null, null, null, null, changesPageToken, null, null, null, null, null, null, null, null, null, null, null, null, changesDriveChangesWatchBodyParam, (data, error) => {
479
- try {
480
- if (stub) {
481
- const displayE = 'Error 400 received on request';
482
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
483
- } else {
484
- runCommonAsserts(data, error);
485
- }
486
- saveMockData('Changes', 'driveChangesWatch', 'default', data);
487
- done();
488
- } catch (err) {
489
- log.error(`Test Failure: ${err}`);
490
- done(err);
386
+ try {
387
+ a.driveChangesWatch(null, null, null, null, null, null, null, changesPageToken, null, null, null, null, null, null, null, null, null, null, null, null, changesDriveChangesWatchBodyParam, (data, error) => {
388
+ try {
389
+ if (stub) {
390
+ const displayE = 'Error 400 received on request';
391
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
392
+ } else {
393
+ runCommonAsserts(data, error);
491
394
  }
492
- });
493
- } catch (error) {
494
- log.error(`Adapter Exception: ${error}`);
495
- done(error);
496
- }
497
- } else {
498
- log.error('driveChangesWatch task is false, skipping test');
499
- skipCount += 1;
500
- done();
501
- }// end if task
395
+ saveMockData('Changes', 'driveChangesWatch', 'default', data);
396
+ done();
397
+ } catch (err) {
398
+ log.error(`Test Failure: ${err}`);
399
+ done(err);
400
+ }
401
+ });
402
+ } catch (error) {
403
+ log.error(`Adapter Exception: ${error}`);
404
+ done(error);
405
+ }
502
406
  }).timeout(attemptTimeout);
503
407
  });
504
408
 
505
409
  describe('#driveChangesList - errors', () => {
506
410
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
507
- if (pronghorn.methodsByName.driveChangesList.task) {
508
- try {
509
- a.driveChangesList(null, null, null, null, null, null, null, changesPageToken, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
510
- try {
511
- if (stub) {
512
- const displayE = 'Error 400 received on request';
513
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
514
- } else {
515
- runCommonAsserts(data, error);
516
- }
517
- saveMockData('Changes', 'driveChangesList', 'default', data);
518
- done();
519
- } catch (err) {
520
- log.error(`Test Failure: ${err}`);
521
- done(err);
411
+ try {
412
+ a.driveChangesList(null, null, null, null, null, null, null, changesPageToken, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
413
+ try {
414
+ if (stub) {
415
+ const displayE = 'Error 400 received on request';
416
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
417
+ } else {
418
+ runCommonAsserts(data, error);
522
419
  }
523
- });
524
- } catch (error) {
525
- log.error(`Adapter Exception: ${error}`);
526
- done(error);
527
- }
528
- } else {
529
- log.error('driveChangesList task is false, skipping test');
530
- skipCount += 1;
531
- done();
532
- }// end if task
420
+ saveMockData('Changes', 'driveChangesList', 'default', data);
421
+ done();
422
+ } catch (err) {
423
+ log.error(`Test Failure: ${err}`);
424
+ done(err);
425
+ }
426
+ });
427
+ } catch (error) {
428
+ log.error(`Adapter Exception: ${error}`);
429
+ done(error);
430
+ }
533
431
  }).timeout(attemptTimeout);
534
432
  });
535
433
 
536
434
  describe('#driveChangesGetStartPageToken - errors', () => {
537
435
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
538
- if (pronghorn.methodsByName.driveChangesGetStartPageToken.task) {
539
- try {
540
- a.driveChangesGetStartPageToken(null, null, null, 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-google_drive-connectorRest-handleEndResponse', displayE);
545
- } else {
546
- runCommonAsserts(data, error);
547
- }
548
- saveMockData('Changes', 'driveChangesGetStartPageToken', 'default', data);
549
- done();
550
- } catch (err) {
551
- log.error(`Test Failure: ${err}`);
552
- done(err);
436
+ try {
437
+ a.driveChangesGetStartPageToken(null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
438
+ try {
439
+ if (stub) {
440
+ const displayE = 'Error 400 received on request';
441
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
442
+ } else {
443
+ runCommonAsserts(data, error);
553
444
  }
554
- });
555
- } catch (error) {
556
- log.error(`Adapter Exception: ${error}`);
557
- done(error);
558
- }
559
- } else {
560
- log.error('driveChangesGetStartPageToken task is false, skipping test');
561
- skipCount += 1;
562
- done();
563
- }// end if task
445
+ saveMockData('Changes', 'driveChangesGetStartPageToken', 'default', data);
446
+ done();
447
+ } catch (err) {
448
+ log.error(`Test Failure: ${err}`);
449
+ done(err);
450
+ }
451
+ });
452
+ } catch (error) {
453
+ log.error(`Adapter Exception: ${error}`);
454
+ done(error);
455
+ }
564
456
  }).timeout(attemptTimeout);
565
457
  });
566
458
 
@@ -578,32 +470,26 @@ describe('[integration] Google_drive Adapter Test', () => {
578
470
  };
579
471
  describe('#driveChannelsStop - errors', () => {
580
472
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
581
- if (pronghorn.methodsByName.driveChannelsStop.task) {
582
- try {
583
- a.driveChannelsStop(null, null, null, null, null, null, null, channelsDriveChannelsStopBodyParam, (data, error) => {
584
- try {
585
- if (stub) {
586
- const displayE = 'Error 400 received on request';
587
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
588
- } else {
589
- runCommonAsserts(data, error);
590
- }
591
- saveMockData('Channels', 'driveChannelsStop', 'default', data);
592
- done();
593
- } catch (err) {
594
- log.error(`Test Failure: ${err}`);
595
- done(err);
473
+ try {
474
+ a.driveChannelsStop(null, null, null, null, null, null, null, channelsDriveChannelsStopBodyParam, (data, error) => {
475
+ try {
476
+ if (stub) {
477
+ const displayE = 'Error 400 received on request';
478
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
479
+ } else {
480
+ runCommonAsserts(data, error);
596
481
  }
597
- });
598
- } catch (error) {
599
- log.error(`Adapter Exception: ${error}`);
600
- done(error);
601
- }
602
- } else {
603
- log.error('driveChannelsStop task is false, skipping test');
604
- skipCount += 1;
605
- done();
606
- }// end if task
482
+ saveMockData('Channels', 'driveChannelsStop', 'default', data);
483
+ done();
484
+ } catch (err) {
485
+ log.error(`Test Failure: ${err}`);
486
+ done(err);
487
+ }
488
+ });
489
+ } catch (error) {
490
+ log.error(`Adapter Exception: ${error}`);
491
+ done(error);
492
+ }
607
493
  }).timeout(attemptTimeout);
608
494
  });
609
495
 
@@ -653,126 +539,102 @@ describe('[integration] Google_drive Adapter Test', () => {
653
539
  };
654
540
  describe('#driveDrivesCreate - errors', () => {
655
541
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
656
- if (pronghorn.methodsByName.driveDrivesCreate.task) {
657
- try {
658
- a.driveDrivesCreate(null, null, null, null, null, null, null, drivesRequestId, drivesDriveDrivesCreateBodyParam, (data, error) => {
659
- try {
660
- if (stub) {
661
- const displayE = 'Error 400 received on request';
662
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
663
- } else {
664
- runCommonAsserts(data, error);
665
- }
666
- saveMockData('Drives', 'driveDrivesCreate', 'default', data);
667
- done();
668
- } catch (err) {
669
- log.error(`Test Failure: ${err}`);
670
- done(err);
542
+ try {
543
+ a.driveDrivesCreate(null, null, null, null, null, null, null, drivesRequestId, drivesDriveDrivesCreateBodyParam, (data, error) => {
544
+ try {
545
+ if (stub) {
546
+ const displayE = 'Error 400 received on request';
547
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
548
+ } else {
549
+ runCommonAsserts(data, error);
671
550
  }
672
- });
673
- } catch (error) {
674
- log.error(`Adapter Exception: ${error}`);
675
- done(error);
676
- }
677
- } else {
678
- log.error('driveDrivesCreate task is false, skipping test');
679
- skipCount += 1;
680
- done();
681
- }// end if task
551
+ saveMockData('Drives', 'driveDrivesCreate', 'default', data);
552
+ done();
553
+ } catch (err) {
554
+ log.error(`Test Failure: ${err}`);
555
+ done(err);
556
+ }
557
+ });
558
+ } catch (error) {
559
+ log.error(`Adapter Exception: ${error}`);
560
+ done(error);
561
+ }
682
562
  }).timeout(attemptTimeout);
683
563
  });
684
564
 
685
565
  const drivesDriveId = 'fakedata';
686
566
  describe('#driveDrivesHide - errors', () => {
687
567
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
688
- if (pronghorn.methodsByName.driveDrivesHide.task) {
689
- try {
690
- a.driveDrivesHide(null, null, null, null, null, null, null, drivesDriveId, (data, error) => {
691
- try {
692
- if (stub) {
693
- const displayE = 'Error 400 received on request';
694
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
695
- } else {
696
- runCommonAsserts(data, error);
697
- }
698
- saveMockData('Drives', 'driveDrivesHide', 'default', data);
699
- done();
700
- } catch (err) {
701
- log.error(`Test Failure: ${err}`);
702
- done(err);
568
+ try {
569
+ a.driveDrivesHide(null, null, null, null, null, null, null, drivesDriveId, (data, error) => {
570
+ try {
571
+ if (stub) {
572
+ const displayE = 'Error 400 received on request';
573
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
574
+ } else {
575
+ runCommonAsserts(data, error);
703
576
  }
704
- });
705
- } catch (error) {
706
- log.error(`Adapter Exception: ${error}`);
707
- done(error);
708
- }
709
- } else {
710
- log.error('driveDrivesHide task is false, skipping test');
711
- skipCount += 1;
712
- done();
713
- }// end if task
577
+ saveMockData('Drives', 'driveDrivesHide', 'default', data);
578
+ done();
579
+ } catch (err) {
580
+ log.error(`Test Failure: ${err}`);
581
+ done(err);
582
+ }
583
+ });
584
+ } catch (error) {
585
+ log.error(`Adapter Exception: ${error}`);
586
+ done(error);
587
+ }
714
588
  }).timeout(attemptTimeout);
715
589
  });
716
590
 
717
591
  describe('#driveDrivesUnhide - errors', () => {
718
592
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
719
- if (pronghorn.methodsByName.driveDrivesUnhide.task) {
720
- try {
721
- a.driveDrivesUnhide(null, null, null, null, null, null, null, drivesDriveId, (data, error) => {
722
- try {
723
- if (stub) {
724
- const displayE = 'Error 400 received on request';
725
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
726
- } else {
727
- runCommonAsserts(data, error);
728
- }
729
- saveMockData('Drives', 'driveDrivesUnhide', 'default', data);
730
- done();
731
- } catch (err) {
732
- log.error(`Test Failure: ${err}`);
733
- done(err);
593
+ try {
594
+ a.driveDrivesUnhide(null, null, null, null, null, null, null, drivesDriveId, (data, error) => {
595
+ try {
596
+ if (stub) {
597
+ const displayE = 'Error 400 received on request';
598
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
599
+ } else {
600
+ runCommonAsserts(data, error);
734
601
  }
735
- });
736
- } catch (error) {
737
- log.error(`Adapter Exception: ${error}`);
738
- done(error);
739
- }
740
- } else {
741
- log.error('driveDrivesUnhide task is false, skipping test');
742
- skipCount += 1;
743
- done();
744
- }// end if task
602
+ saveMockData('Drives', 'driveDrivesUnhide', 'default', data);
603
+ done();
604
+ } catch (err) {
605
+ log.error(`Test Failure: ${err}`);
606
+ done(err);
607
+ }
608
+ });
609
+ } catch (error) {
610
+ log.error(`Adapter Exception: ${error}`);
611
+ done(error);
612
+ }
745
613
  }).timeout(attemptTimeout);
746
614
  });
747
615
 
748
616
  describe('#driveDrivesList - errors', () => {
749
617
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
750
- if (pronghorn.methodsByName.driveDrivesList.task) {
751
- try {
752
- a.driveDrivesList(null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
753
- try {
754
- if (stub) {
755
- const displayE = 'Error 400 received on request';
756
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
757
- } else {
758
- runCommonAsserts(data, error);
759
- }
760
- saveMockData('Drives', 'driveDrivesList', 'default', data);
761
- done();
762
- } catch (err) {
763
- log.error(`Test Failure: ${err}`);
764
- done(err);
618
+ try {
619
+ a.driveDrivesList(null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
620
+ try {
621
+ if (stub) {
622
+ const displayE = 'Error 400 received on request';
623
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
624
+ } else {
625
+ runCommonAsserts(data, error);
765
626
  }
766
- });
767
- } catch (error) {
768
- log.error(`Adapter Exception: ${error}`);
769
- done(error);
770
- }
771
- } else {
772
- log.error('driveDrivesList task is false, skipping test');
773
- skipCount += 1;
774
- done();
775
- }// end if task
627
+ saveMockData('Drives', 'driveDrivesList', 'default', data);
628
+ done();
629
+ } catch (err) {
630
+ log.error(`Test Failure: ${err}`);
631
+ done(err);
632
+ }
633
+ });
634
+ } catch (error) {
635
+ log.error(`Adapter Exception: ${error}`);
636
+ done(error);
637
+ }
776
638
  }).timeout(attemptTimeout);
777
639
  });
778
640
 
@@ -821,63 +683,51 @@ describe('[integration] Google_drive Adapter Test', () => {
821
683
  };
822
684
  describe('#driveDrivesUpdate - errors', () => {
823
685
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
824
- if (pronghorn.methodsByName.driveDrivesUpdate.task) {
825
- try {
826
- a.driveDrivesUpdate(null, null, null, null, null, null, null, drivesDriveId, null, drivesDriveDrivesUpdateBodyParam, (data, error) => {
827
- try {
828
- if (stub) {
829
- const displayE = 'Error 400 received on request';
830
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
831
- } else {
832
- runCommonAsserts(data, error);
833
- }
834
- saveMockData('Drives', 'driveDrivesUpdate', 'default', data);
835
- done();
836
- } catch (err) {
837
- log.error(`Test Failure: ${err}`);
838
- done(err);
686
+ try {
687
+ a.driveDrivesUpdate(null, null, null, null, null, null, null, drivesDriveId, null, drivesDriveDrivesUpdateBodyParam, (data, error) => {
688
+ try {
689
+ if (stub) {
690
+ const displayE = 'Error 400 received on request';
691
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
692
+ } else {
693
+ runCommonAsserts(data, error);
839
694
  }
840
- });
841
- } catch (error) {
842
- log.error(`Adapter Exception: ${error}`);
843
- done(error);
844
- }
845
- } else {
846
- log.error('driveDrivesUpdate task is false, skipping test');
847
- skipCount += 1;
848
- done();
849
- }// end if task
695
+ saveMockData('Drives', 'driveDrivesUpdate', 'default', data);
696
+ done();
697
+ } catch (err) {
698
+ log.error(`Test Failure: ${err}`);
699
+ done(err);
700
+ }
701
+ });
702
+ } catch (error) {
703
+ log.error(`Adapter Exception: ${error}`);
704
+ done(error);
705
+ }
850
706
  }).timeout(attemptTimeout);
851
707
  });
852
708
 
853
709
  describe('#driveDrivesGet - errors', () => {
854
710
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
855
- if (pronghorn.methodsByName.driveDrivesGet.task) {
856
- try {
857
- a.driveDrivesGet(null, null, null, null, null, null, null, drivesDriveId, null, (data, error) => {
858
- try {
859
- if (stub) {
860
- const displayE = 'Error 400 received on request';
861
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
862
- } else {
863
- runCommonAsserts(data, error);
864
- }
865
- saveMockData('Drives', 'driveDrivesGet', 'default', data);
866
- done();
867
- } catch (err) {
868
- log.error(`Test Failure: ${err}`);
869
- done(err);
711
+ try {
712
+ a.driveDrivesGet(null, null, null, null, null, null, null, drivesDriveId, null, (data, error) => {
713
+ try {
714
+ if (stub) {
715
+ const displayE = 'Error 400 received on request';
716
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
717
+ } else {
718
+ runCommonAsserts(data, error);
870
719
  }
871
- });
872
- } catch (error) {
873
- log.error(`Adapter Exception: ${error}`);
874
- done(error);
875
- }
876
- } else {
877
- log.error('driveDrivesGet task is false, skipping test');
878
- skipCount += 1;
879
- done();
880
- }// end if task
720
+ saveMockData('Drives', 'driveDrivesGet', 'default', data);
721
+ done();
722
+ } catch (err) {
723
+ log.error(`Test Failure: ${err}`);
724
+ done(err);
725
+ }
726
+ });
727
+ } catch (error) {
728
+ log.error(`Adapter Exception: ${error}`);
729
+ done(error);
730
+ }
881
731
  }).timeout(attemptTimeout);
882
732
  });
883
733
 
@@ -1107,32 +957,26 @@ describe('[integration] Google_drive Adapter Test', () => {
1107
957
  };
1108
958
  describe('#driveFilesCreate - errors', () => {
1109
959
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1110
- if (pronghorn.methodsByName.driveFilesCreate.task) {
1111
- try {
1112
- a.driveFilesCreate(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, filesDriveFilesCreateBodyParam, (data, error) => {
1113
- try {
1114
- if (stub) {
1115
- const displayE = 'Error 400 received on request';
1116
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1117
- } else {
1118
- runCommonAsserts(data, error);
1119
- }
1120
- saveMockData('Files', 'driveFilesCreate', 'default', data);
1121
- done();
1122
- } catch (err) {
1123
- log.error(`Test Failure: ${err}`);
1124
- done(err);
960
+ try {
961
+ a.driveFilesCreate(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, filesDriveFilesCreateBodyParam, (data, error) => {
962
+ try {
963
+ if (stub) {
964
+ const displayE = 'Error 400 received on request';
965
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
966
+ } else {
967
+ runCommonAsserts(data, error);
1125
968
  }
1126
- });
1127
- } catch (error) {
1128
- log.error(`Adapter Exception: ${error}`);
1129
- done(error);
1130
- }
1131
- } else {
1132
- log.error('driveFilesCreate task is false, skipping test');
1133
- skipCount += 1;
1134
- done();
1135
- }// end if task
969
+ saveMockData('Files', 'driveFilesCreate', 'default', data);
970
+ done();
971
+ } catch (err) {
972
+ log.error(`Test Failure: ${err}`);
973
+ done(err);
974
+ }
975
+ });
976
+ } catch (error) {
977
+ log.error(`Adapter Exception: ${error}`);
978
+ done(error);
979
+ }
1136
980
  }).timeout(attemptTimeout);
1137
981
  });
1138
982
 
@@ -1363,32 +1207,26 @@ describe('[integration] Google_drive Adapter Test', () => {
1363
1207
  };
1364
1208
  describe('#driveFilesCopy - errors', () => {
1365
1209
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1366
- if (pronghorn.methodsByName.driveFilesCopy.task) {
1367
- try {
1368
- a.driveFilesCopy(null, null, null, null, null, null, null, filesFileId, null, null, null, null, null, null, null, filesDriveFilesCopyBodyParam, (data, error) => {
1369
- try {
1370
- if (stub) {
1371
- const displayE = 'Error 400 received on request';
1372
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1373
- } else {
1374
- runCommonAsserts(data, error);
1375
- }
1376
- saveMockData('Files', 'driveFilesCopy', 'default', data);
1377
- done();
1378
- } catch (err) {
1379
- log.error(`Test Failure: ${err}`);
1380
- done(err);
1210
+ try {
1211
+ a.driveFilesCopy(null, null, null, null, null, null, null, filesFileId, null, null, null, null, null, null, null, filesDriveFilesCopyBodyParam, (data, error) => {
1212
+ try {
1213
+ if (stub) {
1214
+ const displayE = 'Error 400 received on request';
1215
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1216
+ } else {
1217
+ runCommonAsserts(data, error);
1381
1218
  }
1382
- });
1383
- } catch (error) {
1384
- log.error(`Adapter Exception: ${error}`);
1385
- done(error);
1386
- }
1387
- } else {
1388
- log.error('driveFilesCopy task is false, skipping test');
1389
- skipCount += 1;
1390
- done();
1391
- }// end if task
1219
+ saveMockData('Files', 'driveFilesCopy', 'default', data);
1220
+ done();
1221
+ } catch (err) {
1222
+ log.error(`Test Failure: ${err}`);
1223
+ done(err);
1224
+ }
1225
+ });
1226
+ } catch (error) {
1227
+ log.error(`Adapter Exception: ${error}`);
1228
+ done(error);
1229
+ }
1392
1230
  }).timeout(attemptTimeout);
1393
1231
  });
1394
1232
 
@@ -1406,94 +1244,76 @@ describe('[integration] Google_drive Adapter Test', () => {
1406
1244
  };
1407
1245
  describe('#driveFilesWatch - errors', () => {
1408
1246
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1409
- if (pronghorn.methodsByName.driveFilesWatch.task) {
1410
- try {
1411
- a.driveFilesWatch(null, null, null, null, null, null, null, filesFileId, null, null, null, null, filesDriveFilesWatchBodyParam, (data, error) => {
1412
- try {
1413
- if (stub) {
1414
- const displayE = 'Error 400 received on request';
1415
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1416
- } else {
1417
- runCommonAsserts(data, error);
1418
- }
1419
- saveMockData('Files', 'driveFilesWatch', 'default', data);
1420
- done();
1421
- } catch (err) {
1422
- log.error(`Test Failure: ${err}`);
1423
- done(err);
1247
+ try {
1248
+ a.driveFilesWatch(null, null, null, null, null, null, null, filesFileId, null, null, null, null, filesDriveFilesWatchBodyParam, (data, error) => {
1249
+ try {
1250
+ if (stub) {
1251
+ const displayE = 'Error 400 received on request';
1252
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1253
+ } else {
1254
+ runCommonAsserts(data, error);
1424
1255
  }
1425
- });
1426
- } catch (error) {
1427
- log.error(`Adapter Exception: ${error}`);
1428
- done(error);
1429
- }
1430
- } else {
1431
- log.error('driveFilesWatch task is false, skipping test');
1432
- skipCount += 1;
1433
- done();
1434
- }// end if task
1256
+ saveMockData('Files', 'driveFilesWatch', 'default', data);
1257
+ done();
1258
+ } catch (err) {
1259
+ log.error(`Test Failure: ${err}`);
1260
+ done(err);
1261
+ }
1262
+ });
1263
+ } catch (error) {
1264
+ log.error(`Adapter Exception: ${error}`);
1265
+ done(error);
1266
+ }
1435
1267
  }).timeout(attemptTimeout);
1436
1268
  });
1437
1269
 
1438
1270
  describe('#driveFilesList - errors', () => {
1439
1271
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1440
- if (pronghorn.methodsByName.driveFilesList.task) {
1441
- try {
1442
- a.driveFilesList(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
1443
- try {
1444
- if (stub) {
1445
- const displayE = 'Error 400 received on request';
1446
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1447
- } else {
1448
- runCommonAsserts(data, error);
1449
- }
1450
- saveMockData('Files', 'driveFilesList', 'default', data);
1451
- done();
1452
- } catch (err) {
1453
- log.error(`Test Failure: ${err}`);
1454
- done(err);
1455
- }
1456
- });
1457
- } catch (error) {
1458
- log.error(`Adapter Exception: ${error}`);
1459
- done(error);
1460
- }
1461
- } else {
1462
- log.error('driveFilesList task is false, skipping test');
1463
- skipCount += 1;
1464
- done();
1465
- }// end if task
1272
+ try {
1273
+ a.driveFilesList(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
1274
+ try {
1275
+ if (stub) {
1276
+ const displayE = 'Error 400 received on request';
1277
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1278
+ } else {
1279
+ runCommonAsserts(data, error);
1280
+ }
1281
+ saveMockData('Files', 'driveFilesList', 'default', data);
1282
+ done();
1283
+ } catch (err) {
1284
+ log.error(`Test Failure: ${err}`);
1285
+ done(err);
1286
+ }
1287
+ });
1288
+ } catch (error) {
1289
+ log.error(`Adapter Exception: ${error}`);
1290
+ done(error);
1291
+ }
1466
1292
  }).timeout(attemptTimeout);
1467
1293
  });
1468
1294
 
1469
1295
  describe('#driveFilesGenerateIds - errors', () => {
1470
1296
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1471
- if (pronghorn.methodsByName.driveFilesGenerateIds.task) {
1472
- try {
1473
- a.driveFilesGenerateIds(null, null, null, null, null, null, null, null, null, null, (data, error) => {
1474
- try {
1475
- if (stub) {
1476
- const displayE = 'Error 400 received on request';
1477
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1478
- } else {
1479
- runCommonAsserts(data, error);
1480
- }
1481
- saveMockData('Files', 'driveFilesGenerateIds', 'default', data);
1482
- done();
1483
- } catch (err) {
1484
- log.error(`Test Failure: ${err}`);
1485
- done(err);
1297
+ try {
1298
+ a.driveFilesGenerateIds(null, null, null, null, null, null, null, null, null, null, (data, error) => {
1299
+ try {
1300
+ if (stub) {
1301
+ const displayE = 'Error 400 received on request';
1302
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1303
+ } else {
1304
+ runCommonAsserts(data, error);
1486
1305
  }
1487
- });
1488
- } catch (error) {
1489
- log.error(`Adapter Exception: ${error}`);
1490
- done(error);
1491
- }
1492
- } else {
1493
- log.error('driveFilesGenerateIds task is false, skipping test');
1494
- skipCount += 1;
1495
- done();
1496
- }// end if task
1306
+ saveMockData('Files', 'driveFilesGenerateIds', 'default', data);
1307
+ done();
1308
+ } catch (err) {
1309
+ log.error(`Test Failure: ${err}`);
1310
+ done(err);
1311
+ }
1312
+ });
1313
+ } catch (error) {
1314
+ log.error(`Adapter Exception: ${error}`);
1315
+ done(error);
1316
+ }
1497
1317
  }).timeout(attemptTimeout);
1498
1318
  });
1499
1319
 
@@ -1723,95 +1543,77 @@ describe('[integration] Google_drive Adapter Test', () => {
1723
1543
  };
1724
1544
  describe('#driveFilesUpdate - errors', () => {
1725
1545
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1726
- if (pronghorn.methodsByName.driveFilesUpdate.task) {
1727
- try {
1728
- a.driveFilesUpdate(null, null, null, null, null, null, null, filesFileId, null, null, null, null, null, null, null, null, null, filesDriveFilesUpdateBodyParam, (data, error) => {
1729
- try {
1730
- if (stub) {
1731
- const displayE = 'Error 400 received on request';
1732
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1733
- } else {
1734
- runCommonAsserts(data, error);
1735
- }
1736
- saveMockData('Files', 'driveFilesUpdate', 'default', data);
1737
- done();
1738
- } catch (err) {
1739
- log.error(`Test Failure: ${err}`);
1740
- done(err);
1546
+ try {
1547
+ a.driveFilesUpdate(null, null, null, null, null, null, null, filesFileId, null, null, null, null, null, null, null, null, null, filesDriveFilesUpdateBodyParam, (data, error) => {
1548
+ try {
1549
+ if (stub) {
1550
+ const displayE = 'Error 400 received on request';
1551
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1552
+ } else {
1553
+ runCommonAsserts(data, error);
1741
1554
  }
1742
- });
1743
- } catch (error) {
1744
- log.error(`Adapter Exception: ${error}`);
1745
- done(error);
1746
- }
1747
- } else {
1748
- log.error('driveFilesUpdate task is false, skipping test');
1749
- skipCount += 1;
1750
- done();
1751
- }// end if task
1555
+ saveMockData('Files', 'driveFilesUpdate', 'default', data);
1556
+ done();
1557
+ } catch (err) {
1558
+ log.error(`Test Failure: ${err}`);
1559
+ done(err);
1560
+ }
1561
+ });
1562
+ } catch (error) {
1563
+ log.error(`Adapter Exception: ${error}`);
1564
+ done(error);
1565
+ }
1752
1566
  }).timeout(attemptTimeout);
1753
1567
  });
1754
1568
 
1755
1569
  describe('#driveFilesGet - errors', () => {
1756
1570
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1757
- if (pronghorn.methodsByName.driveFilesGet.task) {
1758
- try {
1759
- a.driveFilesGet(null, null, null, null, null, null, null, filesFileId, null, null, null, null, (data, error) => {
1760
- try {
1761
- if (stub) {
1762
- const displayE = 'Error 400 received on request';
1763
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1764
- } else {
1765
- runCommonAsserts(data, error);
1766
- }
1767
- saveMockData('Files', 'driveFilesGet', 'default', data);
1768
- done();
1769
- } catch (err) {
1770
- log.error(`Test Failure: ${err}`);
1771
- done(err);
1571
+ try {
1572
+ a.driveFilesGet(null, null, null, null, null, null, null, filesFileId, null, null, null, null, (data, error) => {
1573
+ try {
1574
+ if (stub) {
1575
+ const displayE = 'Error 400 received on request';
1576
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1577
+ } else {
1578
+ runCommonAsserts(data, error);
1772
1579
  }
1773
- });
1774
- } catch (error) {
1775
- log.error(`Adapter Exception: ${error}`);
1776
- done(error);
1777
- }
1778
- } else {
1779
- log.error('driveFilesGet task is false, skipping test');
1780
- skipCount += 1;
1781
- done();
1782
- }// end if task
1580
+ saveMockData('Files', 'driveFilesGet', 'default', data);
1581
+ done();
1582
+ } catch (err) {
1583
+ log.error(`Test Failure: ${err}`);
1584
+ done(err);
1585
+ }
1586
+ });
1587
+ } catch (error) {
1588
+ log.error(`Adapter Exception: ${error}`);
1589
+ done(error);
1590
+ }
1783
1591
  }).timeout(attemptTimeout);
1784
1592
  });
1785
1593
 
1786
1594
  const filesMimeType = 'fakedata';
1787
1595
  describe('#driveFilesExport - errors', () => {
1788
1596
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1789
- if (pronghorn.methodsByName.driveFilesExport.task) {
1790
- try {
1791
- a.driveFilesExport(null, null, null, null, null, null, null, filesFileId, filesMimeType, (data, error) => {
1792
- try {
1793
- if (stub) {
1794
- const displayE = 'Error 400 received on request';
1795
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1796
- } else {
1797
- runCommonAsserts(data, error);
1798
- }
1799
- saveMockData('Files', 'driveFilesExport', 'default', data);
1800
- done();
1801
- } catch (err) {
1802
- log.error(`Test Failure: ${err}`);
1803
- done(err);
1597
+ try {
1598
+ a.driveFilesExport(null, null, null, null, null, null, null, filesFileId, filesMimeType, (data, error) => {
1599
+ try {
1600
+ if (stub) {
1601
+ const displayE = 'Error 400 received on request';
1602
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1603
+ } else {
1604
+ runCommonAsserts(data, error);
1804
1605
  }
1805
- });
1806
- } catch (error) {
1807
- log.error(`Adapter Exception: ${error}`);
1808
- done(error);
1809
- }
1810
- } else {
1811
- log.error('driveFilesExport task is false, skipping test');
1812
- skipCount += 1;
1813
- done();
1814
- }// end if task
1606
+ saveMockData('Files', 'driveFilesExport', 'default', data);
1607
+ done();
1608
+ } catch (err) {
1609
+ log.error(`Test Failure: ${err}`);
1610
+ done(err);
1611
+ }
1612
+ });
1613
+ } catch (error) {
1614
+ log.error(`Adapter Exception: ${error}`);
1615
+ done(error);
1616
+ }
1815
1617
  }).timeout(attemptTimeout);
1816
1618
  });
1817
1619
 
@@ -1861,63 +1663,51 @@ describe('[integration] Google_drive Adapter Test', () => {
1861
1663
  };
1862
1664
  describe('#driveCommentsCreate - errors', () => {
1863
1665
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1864
- if (pronghorn.methodsByName.driveCommentsCreate.task) {
1865
- try {
1866
- a.driveCommentsCreate(null, null, null, null, null, null, null, commentsFileId, commentsDriveCommentsCreateBodyParam, (data, error) => {
1867
- try {
1868
- if (stub) {
1869
- const displayE = 'Error 400 received on request';
1870
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1871
- } else {
1872
- runCommonAsserts(data, error);
1873
- }
1874
- saveMockData('Comments', 'driveCommentsCreate', 'default', data);
1875
- done();
1876
- } catch (err) {
1877
- log.error(`Test Failure: ${err}`);
1878
- done(err);
1666
+ try {
1667
+ a.driveCommentsCreate(null, null, null, null, null, null, null, commentsFileId, commentsDriveCommentsCreateBodyParam, (data, error) => {
1668
+ try {
1669
+ if (stub) {
1670
+ const displayE = 'Error 400 received on request';
1671
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1672
+ } else {
1673
+ runCommonAsserts(data, error);
1879
1674
  }
1880
- });
1881
- } catch (error) {
1882
- log.error(`Adapter Exception: ${error}`);
1883
- done(error);
1884
- }
1885
- } else {
1886
- log.error('driveCommentsCreate task is false, skipping test');
1887
- skipCount += 1;
1888
- done();
1889
- }// end if task
1675
+ saveMockData('Comments', 'driveCommentsCreate', 'default', data);
1676
+ done();
1677
+ } catch (err) {
1678
+ log.error(`Test Failure: ${err}`);
1679
+ done(err);
1680
+ }
1681
+ });
1682
+ } catch (error) {
1683
+ log.error(`Adapter Exception: ${error}`);
1684
+ done(error);
1685
+ }
1890
1686
  }).timeout(attemptTimeout);
1891
1687
  });
1892
1688
 
1893
1689
  describe('#driveCommentsList - errors', () => {
1894
1690
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1895
- if (pronghorn.methodsByName.driveCommentsList.task) {
1896
- try {
1897
- a.driveCommentsList(null, null, null, null, null, null, null, commentsFileId, null, null, null, null, (data, error) => {
1898
- try {
1899
- if (stub) {
1900
- const displayE = 'Error 400 received on request';
1901
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1902
- } else {
1903
- runCommonAsserts(data, error);
1904
- }
1905
- saveMockData('Comments', 'driveCommentsList', 'default', data);
1906
- done();
1907
- } catch (err) {
1908
- log.error(`Test Failure: ${err}`);
1909
- done(err);
1691
+ try {
1692
+ a.driveCommentsList(null, null, null, null, null, null, null, commentsFileId, null, null, null, null, (data, error) => {
1693
+ try {
1694
+ if (stub) {
1695
+ const displayE = 'Error 400 received on request';
1696
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1697
+ } else {
1698
+ runCommonAsserts(data, error);
1910
1699
  }
1911
- });
1912
- } catch (error) {
1913
- log.error(`Adapter Exception: ${error}`);
1914
- done(error);
1915
- }
1916
- } else {
1917
- log.error('driveCommentsList task is false, skipping test');
1918
- skipCount += 1;
1919
- done();
1920
- }// end if task
1700
+ saveMockData('Comments', 'driveCommentsList', 'default', data);
1701
+ done();
1702
+ } catch (err) {
1703
+ log.error(`Test Failure: ${err}`);
1704
+ done(err);
1705
+ }
1706
+ });
1707
+ } catch (error) {
1708
+ log.error(`Adapter Exception: ${error}`);
1709
+ done(error);
1710
+ }
1921
1711
  }).timeout(attemptTimeout);
1922
1712
  });
1923
1713
 
@@ -1967,63 +1757,51 @@ describe('[integration] Google_drive Adapter Test', () => {
1967
1757
  };
1968
1758
  describe('#driveCommentsUpdate - errors', () => {
1969
1759
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1970
- if (pronghorn.methodsByName.driveCommentsUpdate.task) {
1971
- try {
1972
- a.driveCommentsUpdate(null, null, null, null, null, null, null, commentsFileId, commentsCommentId, commentsDriveCommentsUpdateBodyParam, (data, error) => {
1973
- try {
1974
- if (stub) {
1975
- const displayE = 'Error 400 received on request';
1976
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1977
- } else {
1978
- runCommonAsserts(data, error);
1979
- }
1980
- saveMockData('Comments', 'driveCommentsUpdate', 'default', data);
1981
- done();
1982
- } catch (err) {
1983
- log.error(`Test Failure: ${err}`);
1984
- done(err);
1760
+ try {
1761
+ a.driveCommentsUpdate(null, null, null, null, null, null, null, commentsFileId, commentsCommentId, commentsDriveCommentsUpdateBodyParam, (data, error) => {
1762
+ try {
1763
+ if (stub) {
1764
+ const displayE = 'Error 400 received on request';
1765
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1766
+ } else {
1767
+ runCommonAsserts(data, error);
1985
1768
  }
1986
- });
1987
- } catch (error) {
1988
- log.error(`Adapter Exception: ${error}`);
1989
- done(error);
1990
- }
1991
- } else {
1992
- log.error('driveCommentsUpdate task is false, skipping test');
1993
- skipCount += 1;
1994
- done();
1995
- }// end if task
1769
+ saveMockData('Comments', 'driveCommentsUpdate', 'default', data);
1770
+ done();
1771
+ } catch (err) {
1772
+ log.error(`Test Failure: ${err}`);
1773
+ done(err);
1774
+ }
1775
+ });
1776
+ } catch (error) {
1777
+ log.error(`Adapter Exception: ${error}`);
1778
+ done(error);
1779
+ }
1996
1780
  }).timeout(attemptTimeout);
1997
1781
  });
1998
1782
 
1999
1783
  describe('#driveCommentsGet - errors', () => {
2000
1784
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2001
- if (pronghorn.methodsByName.driveCommentsGet.task) {
2002
- try {
2003
- a.driveCommentsGet(null, null, null, null, null, null, null, commentsFileId, commentsCommentId, null, (data, error) => {
2004
- try {
2005
- if (stub) {
2006
- const displayE = 'Error 400 received on request';
2007
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2008
- } else {
2009
- runCommonAsserts(data, error);
2010
- }
2011
- saveMockData('Comments', 'driveCommentsGet', 'default', data);
2012
- done();
2013
- } catch (err) {
2014
- log.error(`Test Failure: ${err}`);
2015
- done(err);
1785
+ try {
1786
+ a.driveCommentsGet(null, null, null, null, null, null, null, commentsFileId, commentsCommentId, null, (data, error) => {
1787
+ try {
1788
+ if (stub) {
1789
+ const displayE = 'Error 400 received on request';
1790
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1791
+ } else {
1792
+ runCommonAsserts(data, error);
2016
1793
  }
2017
- });
2018
- } catch (error) {
2019
- log.error(`Adapter Exception: ${error}`);
2020
- done(error);
2021
- }
2022
- } else {
2023
- log.error('driveCommentsGet task is false, skipping test');
2024
- skipCount += 1;
2025
- done();
2026
- }// end if task
1794
+ saveMockData('Comments', 'driveCommentsGet', 'default', data);
1795
+ done();
1796
+ } catch (err) {
1797
+ log.error(`Test Failure: ${err}`);
1798
+ done(err);
1799
+ }
1800
+ });
1801
+ } catch (error) {
1802
+ log.error(`Adapter Exception: ${error}`);
1803
+ done(error);
1804
+ }
2027
1805
  }).timeout(attemptTimeout);
2028
1806
  });
2029
1807
 
@@ -2049,63 +1827,51 @@ describe('[integration] Google_drive Adapter Test', () => {
2049
1827
  };
2050
1828
  describe('#driveRepliesCreate - errors', () => {
2051
1829
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2052
- if (pronghorn.methodsByName.driveRepliesCreate.task) {
2053
- try {
2054
- a.driveRepliesCreate(null, null, null, null, null, null, null, repliesFileId, repliesCommentId, repliesDriveRepliesCreateBodyParam, (data, error) => {
2055
- try {
2056
- if (stub) {
2057
- const displayE = 'Error 400 received on request';
2058
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2059
- } else {
2060
- runCommonAsserts(data, error);
2061
- }
2062
- saveMockData('Replies', 'driveRepliesCreate', 'default', data);
2063
- done();
2064
- } catch (err) {
2065
- log.error(`Test Failure: ${err}`);
2066
- done(err);
1830
+ try {
1831
+ a.driveRepliesCreate(null, null, null, null, null, null, null, repliesFileId, repliesCommentId, repliesDriveRepliesCreateBodyParam, (data, error) => {
1832
+ try {
1833
+ if (stub) {
1834
+ const displayE = 'Error 400 received on request';
1835
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1836
+ } else {
1837
+ runCommonAsserts(data, error);
2067
1838
  }
2068
- });
2069
- } catch (error) {
2070
- log.error(`Adapter Exception: ${error}`);
2071
- done(error);
2072
- }
2073
- } else {
2074
- log.error('driveRepliesCreate task is false, skipping test');
2075
- skipCount += 1;
2076
- done();
2077
- }// end if task
1839
+ saveMockData('Replies', 'driveRepliesCreate', 'default', data);
1840
+ done();
1841
+ } catch (err) {
1842
+ log.error(`Test Failure: ${err}`);
1843
+ done(err);
1844
+ }
1845
+ });
1846
+ } catch (error) {
1847
+ log.error(`Adapter Exception: ${error}`);
1848
+ done(error);
1849
+ }
2078
1850
  }).timeout(attemptTimeout);
2079
1851
  });
2080
1852
 
2081
1853
  describe('#driveRepliesList - errors', () => {
2082
1854
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2083
- if (pronghorn.methodsByName.driveRepliesList.task) {
2084
- try {
2085
- a.driveRepliesList(null, null, null, null, null, null, null, repliesFileId, repliesCommentId, null, null, null, (data, error) => {
2086
- try {
2087
- if (stub) {
2088
- const displayE = 'Error 400 received on request';
2089
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2090
- } else {
2091
- runCommonAsserts(data, error);
2092
- }
2093
- saveMockData('Replies', 'driveRepliesList', 'default', data);
2094
- done();
2095
- } catch (err) {
2096
- log.error(`Test Failure: ${err}`);
2097
- done(err);
1855
+ try {
1856
+ a.driveRepliesList(null, null, null, null, null, null, null, repliesFileId, repliesCommentId, null, null, null, (data, error) => {
1857
+ try {
1858
+ if (stub) {
1859
+ const displayE = 'Error 400 received on request';
1860
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1861
+ } else {
1862
+ runCommonAsserts(data, error);
2098
1863
  }
2099
- });
2100
- } catch (error) {
2101
- log.error(`Adapter Exception: ${error}`);
2102
- done(error);
2103
- }
2104
- } else {
2105
- log.error('driveRepliesList task is false, skipping test');
2106
- skipCount += 1;
2107
- done();
2108
- }// end if task
1864
+ saveMockData('Replies', 'driveRepliesList', 'default', data);
1865
+ done();
1866
+ } catch (err) {
1867
+ log.error(`Test Failure: ${err}`);
1868
+ done(err);
1869
+ }
1870
+ });
1871
+ } catch (error) {
1872
+ log.error(`Adapter Exception: ${error}`);
1873
+ done(error);
1874
+ }
2109
1875
  }).timeout(attemptTimeout);
2110
1876
  });
2111
1877
 
@@ -2130,63 +1896,51 @@ describe('[integration] Google_drive Adapter Test', () => {
2130
1896
  };
2131
1897
  describe('#driveRepliesUpdate - errors', () => {
2132
1898
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2133
- if (pronghorn.methodsByName.driveRepliesUpdate.task) {
2134
- try {
2135
- a.driveRepliesUpdate(null, null, null, null, null, null, null, repliesFileId, repliesCommentId, repliesReplyId, repliesDriveRepliesUpdateBodyParam, (data, error) => {
2136
- try {
2137
- if (stub) {
2138
- const displayE = 'Error 400 received on request';
2139
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2140
- } else {
2141
- runCommonAsserts(data, error);
2142
- }
2143
- saveMockData('Replies', 'driveRepliesUpdate', 'default', data);
2144
- done();
2145
- } catch (err) {
2146
- log.error(`Test Failure: ${err}`);
2147
- done(err);
1899
+ try {
1900
+ a.driveRepliesUpdate(null, null, null, null, null, null, null, repliesFileId, repliesCommentId, repliesReplyId, repliesDriveRepliesUpdateBodyParam, (data, error) => {
1901
+ try {
1902
+ if (stub) {
1903
+ const displayE = 'Error 400 received on request';
1904
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1905
+ } else {
1906
+ runCommonAsserts(data, error);
2148
1907
  }
2149
- });
2150
- } catch (error) {
2151
- log.error(`Adapter Exception: ${error}`);
2152
- done(error);
2153
- }
2154
- } else {
2155
- log.error('driveRepliesUpdate task is false, skipping test');
2156
- skipCount += 1;
2157
- done();
2158
- }// end if task
1908
+ saveMockData('Replies', 'driveRepliesUpdate', 'default', data);
1909
+ done();
1910
+ } catch (err) {
1911
+ log.error(`Test Failure: ${err}`);
1912
+ done(err);
1913
+ }
1914
+ });
1915
+ } catch (error) {
1916
+ log.error(`Adapter Exception: ${error}`);
1917
+ done(error);
1918
+ }
2159
1919
  }).timeout(attemptTimeout);
2160
1920
  });
2161
1921
 
2162
1922
  describe('#driveRepliesGet - errors', () => {
2163
1923
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2164
- if (pronghorn.methodsByName.driveRepliesGet.task) {
2165
- try {
2166
- a.driveRepliesGet(null, null, null, null, null, null, null, repliesFileId, repliesCommentId, repliesReplyId, null, (data, error) => {
2167
- try {
2168
- if (stub) {
2169
- const displayE = 'Error 400 received on request';
2170
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2171
- } else {
2172
- runCommonAsserts(data, error);
2173
- }
2174
- saveMockData('Replies', 'driveRepliesGet', 'default', data);
2175
- done();
2176
- } catch (err) {
2177
- log.error(`Test Failure: ${err}`);
2178
- done(err);
1924
+ try {
1925
+ a.driveRepliesGet(null, null, null, null, null, null, null, repliesFileId, repliesCommentId, repliesReplyId, null, (data, error) => {
1926
+ try {
1927
+ if (stub) {
1928
+ const displayE = 'Error 400 received on request';
1929
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1930
+ } else {
1931
+ runCommonAsserts(data, error);
2179
1932
  }
2180
- });
2181
- } catch (error) {
2182
- log.error(`Adapter Exception: ${error}`);
2183
- done(error);
2184
- }
2185
- } else {
2186
- log.error('driveRepliesGet task is false, skipping test');
2187
- skipCount += 1;
2188
- done();
2189
- }// end if task
1933
+ saveMockData('Replies', 'driveRepliesGet', 'default', data);
1934
+ done();
1935
+ } catch (err) {
1936
+ log.error(`Test Failure: ${err}`);
1937
+ done(err);
1938
+ }
1939
+ });
1940
+ } catch (error) {
1941
+ log.error(`Adapter Exception: ${error}`);
1942
+ done(error);
1943
+ }
2190
1944
  }).timeout(attemptTimeout);
2191
1945
  });
2192
1946
 
@@ -2224,63 +1978,51 @@ describe('[integration] Google_drive Adapter Test', () => {
2224
1978
  };
2225
1979
  describe('#drivePermissionsCreate - errors', () => {
2226
1980
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2227
- if (pronghorn.methodsByName.drivePermissionsCreate.task) {
2228
- try {
2229
- a.drivePermissionsCreate(null, null, null, null, null, null, null, permissionsFileId, null, null, null, null, null, null, null, null, permissionsDrivePermissionsCreateBodyParam, (data, error) => {
2230
- try {
2231
- if (stub) {
2232
- const displayE = 'Error 400 received on request';
2233
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2234
- } else {
2235
- runCommonAsserts(data, error);
2236
- }
2237
- saveMockData('Permissions', 'drivePermissionsCreate', 'default', data);
2238
- done();
2239
- } catch (err) {
2240
- log.error(`Test Failure: ${err}`);
2241
- done(err);
1981
+ try {
1982
+ a.drivePermissionsCreate(null, null, null, null, null, null, null, permissionsFileId, null, null, null, null, null, null, null, null, permissionsDrivePermissionsCreateBodyParam, (data, error) => {
1983
+ try {
1984
+ if (stub) {
1985
+ const displayE = 'Error 400 received on request';
1986
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
1987
+ } else {
1988
+ runCommonAsserts(data, error);
2242
1989
  }
2243
- });
2244
- } catch (error) {
2245
- log.error(`Adapter Exception: ${error}`);
2246
- done(error);
2247
- }
2248
- } else {
2249
- log.error('drivePermissionsCreate task is false, skipping test');
2250
- skipCount += 1;
2251
- done();
2252
- }// end if task
1990
+ saveMockData('Permissions', 'drivePermissionsCreate', 'default', data);
1991
+ done();
1992
+ } catch (err) {
1993
+ log.error(`Test Failure: ${err}`);
1994
+ done(err);
1995
+ }
1996
+ });
1997
+ } catch (error) {
1998
+ log.error(`Adapter Exception: ${error}`);
1999
+ done(error);
2000
+ }
2253
2001
  }).timeout(attemptTimeout);
2254
2002
  });
2255
2003
 
2256
2004
  describe('#drivePermissionsList - errors', () => {
2257
2005
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2258
- if (pronghorn.methodsByName.drivePermissionsList.task) {
2259
- try {
2260
- a.drivePermissionsList(null, null, null, null, null, null, null, permissionsFileId, null, null, null, null, null, null, (data, error) => {
2261
- try {
2262
- if (stub) {
2263
- const displayE = 'Error 400 received on request';
2264
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2265
- } else {
2266
- runCommonAsserts(data, error);
2267
- }
2268
- saveMockData('Permissions', 'drivePermissionsList', 'default', data);
2269
- done();
2270
- } catch (err) {
2271
- log.error(`Test Failure: ${err}`);
2272
- done(err);
2006
+ try {
2007
+ a.drivePermissionsList(null, null, null, null, null, null, null, permissionsFileId, null, null, null, null, null, null, (data, error) => {
2008
+ try {
2009
+ if (stub) {
2010
+ const displayE = 'Error 400 received on request';
2011
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2012
+ } else {
2013
+ runCommonAsserts(data, error);
2273
2014
  }
2274
- });
2275
- } catch (error) {
2276
- log.error(`Adapter Exception: ${error}`);
2277
- done(error);
2278
- }
2279
- } else {
2280
- log.error('drivePermissionsList task is false, skipping test');
2281
- skipCount += 1;
2282
- done();
2283
- }// end if task
2015
+ saveMockData('Permissions', 'drivePermissionsList', '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
+ }
2284
2026
  }).timeout(attemptTimeout);
2285
2027
  });
2286
2028
 
@@ -2318,95 +2060,77 @@ describe('[integration] Google_drive Adapter Test', () => {
2318
2060
  };
2319
2061
  describe('#drivePermissionsUpdate - errors', () => {
2320
2062
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2321
- if (pronghorn.methodsByName.drivePermissionsUpdate.task) {
2322
- try {
2323
- a.drivePermissionsUpdate(null, null, null, null, null, null, null, permissionsFileId, permissionsPermissionId, null, null, null, null, null, permissionsDrivePermissionsUpdateBodyParam, (data, error) => {
2324
- try {
2325
- if (stub) {
2326
- const displayE = 'Error 400 received on request';
2327
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2328
- } else {
2329
- runCommonAsserts(data, error);
2330
- }
2331
- saveMockData('Permissions', 'drivePermissionsUpdate', 'default', data);
2332
- done();
2333
- } catch (err) {
2334
- log.error(`Test Failure: ${err}`);
2335
- done(err);
2063
+ try {
2064
+ a.drivePermissionsUpdate(null, null, null, null, null, null, null, permissionsFileId, permissionsPermissionId, null, null, null, null, null, permissionsDrivePermissionsUpdateBodyParam, (data, error) => {
2065
+ try {
2066
+ if (stub) {
2067
+ const displayE = 'Error 400 received on request';
2068
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2069
+ } else {
2070
+ runCommonAsserts(data, error);
2336
2071
  }
2337
- });
2338
- } catch (error) {
2339
- log.error(`Adapter Exception: ${error}`);
2340
- done(error);
2341
- }
2342
- } else {
2343
- log.error('drivePermissionsUpdate task is false, skipping test');
2344
- skipCount += 1;
2345
- done();
2346
- }// end if task
2072
+ saveMockData('Permissions', 'drivePermissionsUpdate', 'default', data);
2073
+ done();
2074
+ } catch (err) {
2075
+ log.error(`Test Failure: ${err}`);
2076
+ done(err);
2077
+ }
2078
+ });
2079
+ } catch (error) {
2080
+ log.error(`Adapter Exception: ${error}`);
2081
+ done(error);
2082
+ }
2347
2083
  }).timeout(attemptTimeout);
2348
2084
  });
2349
2085
 
2350
2086
  describe('#drivePermissionsGet - errors', () => {
2351
2087
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2352
- if (pronghorn.methodsByName.drivePermissionsGet.task) {
2353
- try {
2354
- a.drivePermissionsGet(null, null, null, null, null, null, null, permissionsFileId, permissionsPermissionId, null, null, null, (data, error) => {
2355
- try {
2356
- if (stub) {
2357
- const displayE = 'Error 400 received on request';
2358
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2359
- } else {
2360
- runCommonAsserts(data, error);
2361
- }
2362
- saveMockData('Permissions', 'drivePermissionsGet', 'default', data);
2363
- done();
2364
- } catch (err) {
2365
- log.error(`Test Failure: ${err}`);
2366
- done(err);
2088
+ try {
2089
+ a.drivePermissionsGet(null, null, null, null, null, null, null, permissionsFileId, permissionsPermissionId, null, null, null, (data, error) => {
2090
+ try {
2091
+ if (stub) {
2092
+ const displayE = 'Error 400 received on request';
2093
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2094
+ } else {
2095
+ runCommonAsserts(data, error);
2367
2096
  }
2368
- });
2369
- } catch (error) {
2370
- log.error(`Adapter Exception: ${error}`);
2371
- done(error);
2372
- }
2373
- } else {
2374
- log.error('drivePermissionsGet task is false, skipping test');
2375
- skipCount += 1;
2376
- done();
2377
- }// end if task
2097
+ saveMockData('Permissions', 'drivePermissionsGet', 'default', data);
2098
+ done();
2099
+ } catch (err) {
2100
+ log.error(`Test Failure: ${err}`);
2101
+ done(err);
2102
+ }
2103
+ });
2104
+ } catch (error) {
2105
+ log.error(`Adapter Exception: ${error}`);
2106
+ done(error);
2107
+ }
2378
2108
  }).timeout(attemptTimeout);
2379
2109
  });
2380
2110
 
2381
2111
  const revisionsFileId = 'fakedata';
2382
2112
  describe('#driveRevisionsList - errors', () => {
2383
2113
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2384
- if (pronghorn.methodsByName.driveRevisionsList.task) {
2385
- try {
2386
- a.driveRevisionsList(null, null, null, null, null, null, null, revisionsFileId, null, null, (data, error) => {
2387
- try {
2388
- if (stub) {
2389
- const displayE = 'Error 400 received on request';
2390
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2391
- } else {
2392
- runCommonAsserts(data, error);
2393
- }
2394
- saveMockData('Revisions', 'driveRevisionsList', 'default', data);
2395
- done();
2396
- } catch (err) {
2397
- log.error(`Test Failure: ${err}`);
2398
- done(err);
2114
+ try {
2115
+ a.driveRevisionsList(null, null, null, null, null, null, null, revisionsFileId, null, null, (data, error) => {
2116
+ try {
2117
+ if (stub) {
2118
+ const displayE = 'Error 400 received on request';
2119
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2120
+ } else {
2121
+ runCommonAsserts(data, error);
2399
2122
  }
2400
- });
2401
- } catch (error) {
2402
- log.error(`Adapter Exception: ${error}`);
2403
- done(error);
2404
- }
2405
- } else {
2406
- log.error('driveRevisionsList task is false, skipping test');
2407
- skipCount += 1;
2408
- done();
2409
- }// end if task
2123
+ saveMockData('Revisions', 'driveRevisionsList', 'default', data);
2124
+ done();
2125
+ } catch (err) {
2126
+ log.error(`Test Failure: ${err}`);
2127
+ done(err);
2128
+ }
2129
+ });
2130
+ } catch (error) {
2131
+ log.error(`Adapter Exception: ${error}`);
2132
+ done(error);
2133
+ }
2410
2134
  }).timeout(attemptTimeout);
2411
2135
  });
2412
2136
 
@@ -2436,63 +2160,51 @@ describe('[integration] Google_drive Adapter Test', () => {
2436
2160
  };
2437
2161
  describe('#driveRevisionsUpdate - errors', () => {
2438
2162
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2439
- if (pronghorn.methodsByName.driveRevisionsUpdate.task) {
2440
- try {
2441
- a.driveRevisionsUpdate(null, null, null, null, null, null, null, revisionsFileId, revisionsRevisionId, revisionsDriveRevisionsUpdateBodyParam, (data, error) => {
2442
- try {
2443
- if (stub) {
2444
- const displayE = 'Error 400 received on request';
2445
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2446
- } else {
2447
- runCommonAsserts(data, error);
2448
- }
2449
- saveMockData('Revisions', 'driveRevisionsUpdate', 'default', data);
2450
- done();
2451
- } catch (err) {
2452
- log.error(`Test Failure: ${err}`);
2453
- done(err);
2163
+ try {
2164
+ a.driveRevisionsUpdate(null, null, null, null, null, null, null, revisionsFileId, revisionsRevisionId, revisionsDriveRevisionsUpdateBodyParam, (data, error) => {
2165
+ try {
2166
+ if (stub) {
2167
+ const displayE = 'Error 400 received on request';
2168
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2169
+ } else {
2170
+ runCommonAsserts(data, error);
2454
2171
  }
2455
- });
2456
- } catch (error) {
2457
- log.error(`Adapter Exception: ${error}`);
2458
- done(error);
2459
- }
2460
- } else {
2461
- log.error('driveRevisionsUpdate task is false, skipping test');
2462
- skipCount += 1;
2463
- done();
2464
- }// end if task
2172
+ saveMockData('Revisions', 'driveRevisionsUpdate', 'default', data);
2173
+ done();
2174
+ } catch (err) {
2175
+ log.error(`Test Failure: ${err}`);
2176
+ done(err);
2177
+ }
2178
+ });
2179
+ } catch (error) {
2180
+ log.error(`Adapter Exception: ${error}`);
2181
+ done(error);
2182
+ }
2465
2183
  }).timeout(attemptTimeout);
2466
2184
  });
2467
2185
 
2468
2186
  describe('#driveRevisionsGet - errors', () => {
2469
2187
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2470
- if (pronghorn.methodsByName.driveRevisionsGet.task) {
2471
- try {
2472
- a.driveRevisionsGet(null, null, null, null, null, null, null, revisionsFileId, revisionsRevisionId, null, (data, error) => {
2473
- try {
2474
- if (stub) {
2475
- const displayE = 'Error 400 received on request';
2476
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2477
- } else {
2478
- runCommonAsserts(data, error);
2479
- }
2480
- saveMockData('Revisions', 'driveRevisionsGet', 'default', data);
2481
- done();
2482
- } catch (err) {
2483
- log.error(`Test Failure: ${err}`);
2484
- done(err);
2188
+ try {
2189
+ a.driveRevisionsGet(null, null, null, null, null, null, null, revisionsFileId, revisionsRevisionId, null, (data, error) => {
2190
+ try {
2191
+ if (stub) {
2192
+ const displayE = 'Error 400 received on request';
2193
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2194
+ } else {
2195
+ runCommonAsserts(data, error);
2485
2196
  }
2486
- });
2487
- } catch (error) {
2488
- log.error(`Adapter Exception: ${error}`);
2489
- done(error);
2490
- }
2491
- } else {
2492
- log.error('driveRevisionsGet task is false, skipping test');
2493
- skipCount += 1;
2494
- done();
2495
- }// end if task
2197
+ saveMockData('Revisions', 'driveRevisionsGet', 'default', data);
2198
+ done();
2199
+ } catch (err) {
2200
+ log.error(`Test Failure: ${err}`);
2201
+ done(err);
2202
+ }
2203
+ });
2204
+ } catch (error) {
2205
+ log.error(`Adapter Exception: ${error}`);
2206
+ done(error);
2207
+ }
2496
2208
  }).timeout(attemptTimeout);
2497
2209
  });
2498
2210
 
@@ -2542,63 +2254,51 @@ describe('[integration] Google_drive Adapter Test', () => {
2542
2254
  };
2543
2255
  describe('#driveTeamdrivesCreate - errors', () => {
2544
2256
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2545
- if (pronghorn.methodsByName.driveTeamdrivesCreate.task) {
2546
- try {
2547
- a.driveTeamdrivesCreate(null, null, null, null, null, null, null, teamdrivesRequestId, teamdrivesDriveTeamdrivesCreateBodyParam, (data, error) => {
2548
- try {
2549
- if (stub) {
2550
- const displayE = 'Error 400 received on request';
2551
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2552
- } else {
2553
- runCommonAsserts(data, error);
2554
- }
2555
- saveMockData('Teamdrives', 'driveTeamdrivesCreate', 'default', data);
2556
- done();
2557
- } catch (err) {
2558
- log.error(`Test Failure: ${err}`);
2559
- done(err);
2257
+ try {
2258
+ a.driveTeamdrivesCreate(null, null, null, null, null, null, null, teamdrivesRequestId, teamdrivesDriveTeamdrivesCreateBodyParam, (data, error) => {
2259
+ try {
2260
+ if (stub) {
2261
+ const displayE = 'Error 400 received on request';
2262
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2263
+ } else {
2264
+ runCommonAsserts(data, error);
2560
2265
  }
2561
- });
2562
- } catch (error) {
2563
- log.error(`Adapter Exception: ${error}`);
2564
- done(error);
2565
- }
2566
- } else {
2567
- log.error('driveTeamdrivesCreate task is false, skipping test');
2568
- skipCount += 1;
2569
- done();
2570
- }// end if task
2266
+ saveMockData('Teamdrives', 'driveTeamdrivesCreate', 'default', data);
2267
+ done();
2268
+ } catch (err) {
2269
+ log.error(`Test Failure: ${err}`);
2270
+ done(err);
2271
+ }
2272
+ });
2273
+ } catch (error) {
2274
+ log.error(`Adapter Exception: ${error}`);
2275
+ done(error);
2276
+ }
2571
2277
  }).timeout(attemptTimeout);
2572
2278
  });
2573
2279
 
2574
2280
  describe('#driveTeamdrivesList - errors', () => {
2575
2281
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2576
- if (pronghorn.methodsByName.driveTeamdrivesList.task) {
2577
- try {
2578
- a.driveTeamdrivesList(null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
2579
- try {
2580
- if (stub) {
2581
- const displayE = 'Error 400 received on request';
2582
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2583
- } else {
2584
- runCommonAsserts(data, error);
2585
- }
2586
- saveMockData('Teamdrives', 'driveTeamdrivesList', 'default', data);
2587
- done();
2588
- } catch (err) {
2589
- log.error(`Test Failure: ${err}`);
2590
- done(err);
2282
+ try {
2283
+ a.driveTeamdrivesList(null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
2284
+ try {
2285
+ if (stub) {
2286
+ const displayE = 'Error 400 received on request';
2287
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2288
+ } else {
2289
+ runCommonAsserts(data, error);
2591
2290
  }
2592
- });
2593
- } catch (error) {
2594
- log.error(`Adapter Exception: ${error}`);
2595
- done(error);
2596
- }
2597
- } else {
2598
- log.error('driveTeamdrivesList task is false, skipping test');
2599
- skipCount += 1;
2600
- done();
2601
- }// end if task
2291
+ saveMockData('Teamdrives', 'driveTeamdrivesList', 'default', data);
2292
+ done();
2293
+ } catch (err) {
2294
+ log.error(`Test Failure: ${err}`);
2295
+ done(err);
2296
+ }
2297
+ });
2298
+ } catch (error) {
2299
+ log.error(`Adapter Exception: ${error}`);
2300
+ done(error);
2301
+ }
2602
2302
  }).timeout(attemptTimeout);
2603
2303
  });
2604
2304
 
@@ -2648,319 +2348,252 @@ describe('[integration] Google_drive Adapter Test', () => {
2648
2348
  };
2649
2349
  describe('#driveTeamdrivesUpdate - errors', () => {
2650
2350
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2651
- if (pronghorn.methodsByName.driveTeamdrivesUpdate.task) {
2652
- try {
2653
- a.driveTeamdrivesUpdate(null, null, null, null, null, null, null, teamdrivesTeamDriveId, null, teamdrivesDriveTeamdrivesUpdateBodyParam, (data, error) => {
2654
- try {
2655
- if (stub) {
2656
- const displayE = 'Error 400 received on request';
2657
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2658
- } else {
2659
- runCommonAsserts(data, error);
2660
- }
2661
- saveMockData('Teamdrives', 'driveTeamdrivesUpdate', 'default', data);
2662
- done();
2663
- } catch (err) {
2664
- log.error(`Test Failure: ${err}`);
2665
- done(err);
2351
+ try {
2352
+ a.driveTeamdrivesUpdate(null, null, null, null, null, null, null, teamdrivesTeamDriveId, null, teamdrivesDriveTeamdrivesUpdateBodyParam, (data, error) => {
2353
+ try {
2354
+ if (stub) {
2355
+ const displayE = 'Error 400 received on request';
2356
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2357
+ } else {
2358
+ runCommonAsserts(data, error);
2666
2359
  }
2667
- });
2668
- } catch (error) {
2669
- log.error(`Adapter Exception: ${error}`);
2670
- done(error);
2671
- }
2672
- } else {
2673
- log.error('driveTeamdrivesUpdate task is false, skipping test');
2674
- skipCount += 1;
2675
- done();
2676
- }// end if task
2360
+ saveMockData('Teamdrives', 'driveTeamdrivesUpdate', 'default', data);
2361
+ done();
2362
+ } catch (err) {
2363
+ log.error(`Test Failure: ${err}`);
2364
+ done(err);
2365
+ }
2366
+ });
2367
+ } catch (error) {
2368
+ log.error(`Adapter Exception: ${error}`);
2369
+ done(error);
2370
+ }
2677
2371
  }).timeout(attemptTimeout);
2678
2372
  });
2679
2373
 
2680
2374
  describe('#driveTeamdrivesGet - errors', () => {
2681
2375
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2682
- if (pronghorn.methodsByName.driveTeamdrivesGet.task) {
2683
- try {
2684
- a.driveTeamdrivesGet(null, null, null, null, null, null, null, teamdrivesTeamDriveId, null, (data, error) => {
2685
- try {
2686
- if (stub) {
2687
- const displayE = 'Error 400 received on request';
2688
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2689
- } else {
2690
- runCommonAsserts(data, error);
2691
- }
2692
- saveMockData('Teamdrives', 'driveTeamdrivesGet', 'default', data);
2693
- done();
2694
- } catch (err) {
2695
- log.error(`Test Failure: ${err}`);
2696
- done(err);
2376
+ try {
2377
+ a.driveTeamdrivesGet(null, null, null, null, null, null, null, teamdrivesTeamDriveId, null, (data, error) => {
2378
+ try {
2379
+ if (stub) {
2380
+ const displayE = 'Error 400 received on request';
2381
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2382
+ } else {
2383
+ runCommonAsserts(data, error);
2697
2384
  }
2698
- });
2699
- } catch (error) {
2700
- log.error(`Adapter Exception: ${error}`);
2701
- done(error);
2702
- }
2703
- } else {
2704
- log.error('driveTeamdrivesGet task is false, skipping test');
2705
- skipCount += 1;
2706
- done();
2707
- }// end if task
2385
+ saveMockData('Teamdrives', 'driveTeamdrivesGet', 'default', data);
2386
+ done();
2387
+ } catch (err) {
2388
+ log.error(`Test Failure: ${err}`);
2389
+ done(err);
2390
+ }
2391
+ });
2392
+ } catch (error) {
2393
+ log.error(`Adapter Exception: ${error}`);
2394
+ done(error);
2395
+ }
2708
2396
  }).timeout(attemptTimeout);
2709
2397
  });
2710
2398
 
2711
2399
  describe('#driveDrivesDelete - errors', () => {
2712
2400
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2713
- if (pronghorn.methodsByName.driveDrivesDelete.task) {
2714
- try {
2715
- a.driveDrivesDelete(null, null, null, null, null, null, null, drivesDriveId, (data, error) => {
2716
- try {
2717
- if (stub) {
2718
- const displayE = 'Error 400 received on request';
2719
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2720
- } else {
2721
- runCommonAsserts(data, error);
2722
- }
2723
- saveMockData('Drives', 'driveDrivesDelete', 'default', data);
2724
- done();
2725
- } catch (err) {
2726
- log.error(`Test Failure: ${err}`);
2727
- done(err);
2401
+ try {
2402
+ a.driveDrivesDelete(null, null, null, null, null, null, null, drivesDriveId, (data, error) => {
2403
+ try {
2404
+ if (stub) {
2405
+ const displayE = 'Error 400 received on request';
2406
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2407
+ } else {
2408
+ runCommonAsserts(data, error);
2728
2409
  }
2729
- });
2730
- } catch (error) {
2731
- log.error(`Adapter Exception: ${error}`);
2732
- done(error);
2733
- }
2734
- } else {
2735
- log.error('driveDrivesDelete task is false, skipping test');
2736
- skipCount += 1;
2737
- done();
2738
- }// end if task
2410
+ saveMockData('Drives', 'driveDrivesDelete', 'default', data);
2411
+ done();
2412
+ } catch (err) {
2413
+ log.error(`Test Failure: ${err}`);
2414
+ done(err);
2415
+ }
2416
+ });
2417
+ } catch (error) {
2418
+ log.error(`Adapter Exception: ${error}`);
2419
+ done(error);
2420
+ }
2739
2421
  }).timeout(attemptTimeout);
2740
2422
  });
2741
2423
 
2742
2424
  describe('#driveFilesEmptyTrash - errors', () => {
2743
2425
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2744
- if (pronghorn.methodsByName.driveFilesEmptyTrash.task) {
2745
- try {
2746
- a.driveFilesEmptyTrash(null, null, null, null, null, null, null, null, (data, error) => {
2747
- try {
2748
- if (stub) {
2749
- const displayE = 'Error 400 received on request';
2750
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2751
- } else {
2752
- runCommonAsserts(data, error);
2753
- }
2754
- saveMockData('Files', 'driveFilesEmptyTrash', 'default', data);
2755
- done();
2756
- } catch (err) {
2757
- log.error(`Test Failure: ${err}`);
2758
- done(err);
2426
+ try {
2427
+ a.driveFilesEmptyTrash(null, null, null, null, null, null, null, null, (data, error) => {
2428
+ try {
2429
+ if (stub) {
2430
+ const displayE = 'Error 400 received on request';
2431
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2432
+ } else {
2433
+ runCommonAsserts(data, error);
2759
2434
  }
2760
- });
2761
- } catch (error) {
2762
- log.error(`Adapter Exception: ${error}`);
2763
- done(error);
2764
- }
2765
- } else {
2766
- log.error('driveFilesEmptyTrash task is false, skipping test');
2767
- skipCount += 1;
2768
- done();
2769
- }// end if task
2435
+ saveMockData('Files', 'driveFilesEmptyTrash', 'default', data);
2436
+ done();
2437
+ } catch (err) {
2438
+ log.error(`Test Failure: ${err}`);
2439
+ done(err);
2440
+ }
2441
+ });
2442
+ } catch (error) {
2443
+ log.error(`Adapter Exception: ${error}`);
2444
+ done(error);
2445
+ }
2770
2446
  }).timeout(attemptTimeout);
2771
2447
  });
2772
2448
 
2773
2449
  describe('#driveFilesDelete - errors', () => {
2774
2450
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2775
- if (pronghorn.methodsByName.driveFilesDelete.task) {
2776
- try {
2777
- a.driveFilesDelete(null, null, null, null, null, null, null, filesFileId, null, null, null, (data, error) => {
2778
- try {
2779
- if (stub) {
2780
- const displayE = 'Error 400 received on request';
2781
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2782
- } else {
2783
- runCommonAsserts(data, error);
2784
- }
2785
- saveMockData('Files', 'driveFilesDelete', 'default', data);
2786
- done();
2787
- } catch (err) {
2788
- log.error(`Test Failure: ${err}`);
2789
- done(err);
2451
+ try {
2452
+ a.driveFilesDelete(null, null, null, null, null, null, null, filesFileId, null, null, null, (data, error) => {
2453
+ try {
2454
+ if (stub) {
2455
+ const displayE = 'Error 400 received on request';
2456
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2457
+ } else {
2458
+ runCommonAsserts(data, error);
2790
2459
  }
2791
- });
2792
- } catch (error) {
2793
- log.error(`Adapter Exception: ${error}`);
2794
- done(error);
2795
- }
2796
- } else {
2797
- log.error('driveFilesDelete task is false, skipping test');
2798
- skipCount += 1;
2799
- done();
2800
- }// end if task
2460
+ saveMockData('Files', 'driveFilesDelete', 'default', data);
2461
+ done();
2462
+ } catch (err) {
2463
+ log.error(`Test Failure: ${err}`);
2464
+ done(err);
2465
+ }
2466
+ });
2467
+ } catch (error) {
2468
+ log.error(`Adapter Exception: ${error}`);
2469
+ done(error);
2470
+ }
2801
2471
  }).timeout(attemptTimeout);
2802
2472
  });
2803
2473
 
2804
2474
  describe('#driveCommentsDelete - errors', () => {
2805
2475
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2806
- if (pronghorn.methodsByName.driveCommentsDelete.task) {
2807
- try {
2808
- a.driveCommentsDelete(null, null, null, null, null, null, null, commentsFileId, commentsCommentId, (data, error) => {
2809
- try {
2810
- if (stub) {
2811
- const displayE = 'Error 400 received on request';
2812
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2813
- } else {
2814
- runCommonAsserts(data, error);
2815
- }
2816
- saveMockData('Comments', 'driveCommentsDelete', 'default', data);
2817
- done();
2818
- } catch (err) {
2819
- log.error(`Test Failure: ${err}`);
2820
- done(err);
2476
+ try {
2477
+ a.driveCommentsDelete(null, null, null, null, null, null, null, commentsFileId, commentsCommentId, (data, error) => {
2478
+ try {
2479
+ if (stub) {
2480
+ const displayE = 'Error 400 received on request';
2481
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2482
+ } else {
2483
+ runCommonAsserts(data, error);
2821
2484
  }
2822
- });
2823
- } catch (error) {
2824
- log.error(`Adapter Exception: ${error}`);
2825
- done(error);
2826
- }
2827
- } else {
2828
- log.error('driveCommentsDelete task is false, skipping test');
2829
- skipCount += 1;
2830
- done();
2831
- }// end if task
2485
+ saveMockData('Comments', 'driveCommentsDelete', 'default', data);
2486
+ done();
2487
+ } catch (err) {
2488
+ log.error(`Test Failure: ${err}`);
2489
+ done(err);
2490
+ }
2491
+ });
2492
+ } catch (error) {
2493
+ log.error(`Adapter Exception: ${error}`);
2494
+ done(error);
2495
+ }
2832
2496
  }).timeout(attemptTimeout);
2833
2497
  });
2834
2498
 
2835
2499
  describe('#driveRepliesDelete - errors', () => {
2836
2500
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2837
- if (pronghorn.methodsByName.driveRepliesDelete.task) {
2838
- try {
2839
- a.driveRepliesDelete(null, null, null, null, null, null, null, repliesFileId, repliesCommentId, repliesReplyId, (data, error) => {
2840
- try {
2841
- if (stub) {
2842
- const displayE = 'Error 400 received on request';
2843
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2844
- } else {
2845
- runCommonAsserts(data, error);
2846
- }
2847
- saveMockData('Replies', 'driveRepliesDelete', 'default', data);
2848
- done();
2849
- } catch (err) {
2850
- log.error(`Test Failure: ${err}`);
2851
- done(err);
2501
+ try {
2502
+ a.driveRepliesDelete(null, null, null, null, null, null, null, repliesFileId, repliesCommentId, repliesReplyId, (data, error) => {
2503
+ try {
2504
+ if (stub) {
2505
+ const displayE = 'Error 400 received on request';
2506
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2507
+ } else {
2508
+ runCommonAsserts(data, error);
2852
2509
  }
2853
- });
2854
- } catch (error) {
2855
- log.error(`Adapter Exception: ${error}`);
2856
- done(error);
2857
- }
2858
- } else {
2859
- log.error('driveRepliesDelete task is false, skipping test');
2860
- skipCount += 1;
2861
- done();
2862
- }// end if task
2510
+ saveMockData('Replies', 'driveRepliesDelete', 'default', data);
2511
+ done();
2512
+ } catch (err) {
2513
+ log.error(`Test Failure: ${err}`);
2514
+ done(err);
2515
+ }
2516
+ });
2517
+ } catch (error) {
2518
+ log.error(`Adapter Exception: ${error}`);
2519
+ done(error);
2520
+ }
2863
2521
  }).timeout(attemptTimeout);
2864
2522
  });
2865
2523
 
2866
2524
  describe('#drivePermissionsDelete - errors', () => {
2867
2525
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2868
- if (pronghorn.methodsByName.drivePermissionsDelete.task) {
2869
- try {
2870
- a.drivePermissionsDelete(null, null, null, null, null, null, null, permissionsFileId, permissionsPermissionId, null, null, null, (data, error) => {
2871
- try {
2872
- if (stub) {
2873
- const displayE = 'Error 400 received on request';
2874
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2875
- } else {
2876
- runCommonAsserts(data, error);
2877
- }
2878
- saveMockData('Permissions', 'drivePermissionsDelete', 'default', data);
2879
- done();
2880
- } catch (err) {
2881
- log.error(`Test Failure: ${err}`);
2882
- done(err);
2526
+ try {
2527
+ a.drivePermissionsDelete(null, null, null, null, null, null, null, permissionsFileId, permissionsPermissionId, null, null, null, (data, error) => {
2528
+ try {
2529
+ if (stub) {
2530
+ const displayE = 'Error 400 received on request';
2531
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2532
+ } else {
2533
+ runCommonAsserts(data, error);
2883
2534
  }
2884
- });
2885
- } catch (error) {
2886
- log.error(`Adapter Exception: ${error}`);
2887
- done(error);
2888
- }
2889
- } else {
2890
- log.error('drivePermissionsDelete task is false, skipping test');
2891
- skipCount += 1;
2892
- done();
2893
- }// end if task
2535
+ saveMockData('Permissions', 'drivePermissionsDelete', 'default', data);
2536
+ done();
2537
+ } catch (err) {
2538
+ log.error(`Test Failure: ${err}`);
2539
+ done(err);
2540
+ }
2541
+ });
2542
+ } catch (error) {
2543
+ log.error(`Adapter Exception: ${error}`);
2544
+ done(error);
2545
+ }
2894
2546
  }).timeout(attemptTimeout);
2895
2547
  });
2896
2548
 
2897
2549
  describe('#driveRevisionsDelete - errors', () => {
2898
2550
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2899
- if (pronghorn.methodsByName.driveRevisionsDelete.task) {
2900
- try {
2901
- a.driveRevisionsDelete(null, null, null, null, null, null, null, revisionsFileId, revisionsRevisionId, (data, error) => {
2902
- try {
2903
- if (stub) {
2904
- const displayE = 'Error 400 received on request';
2905
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2906
- } else {
2907
- runCommonAsserts(data, error);
2908
- }
2909
- saveMockData('Revisions', 'driveRevisionsDelete', 'default', data);
2910
- done();
2911
- } catch (err) {
2912
- log.error(`Test Failure: ${err}`);
2913
- done(err);
2551
+ try {
2552
+ a.driveRevisionsDelete(null, null, null, null, null, null, null, revisionsFileId, revisionsRevisionId, (data, error) => {
2553
+ try {
2554
+ if (stub) {
2555
+ const displayE = 'Error 400 received on request';
2556
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2557
+ } else {
2558
+ runCommonAsserts(data, error);
2914
2559
  }
2915
- });
2916
- } catch (error) {
2917
- log.error(`Adapter Exception: ${error}`);
2918
- done(error);
2919
- }
2920
- } else {
2921
- log.error('driveRevisionsDelete task is false, skipping test');
2922
- skipCount += 1;
2923
- done();
2924
- }// end if task
2560
+ saveMockData('Revisions', 'driveRevisionsDelete', 'default', data);
2561
+ done();
2562
+ } catch (err) {
2563
+ log.error(`Test Failure: ${err}`);
2564
+ done(err);
2565
+ }
2566
+ });
2567
+ } catch (error) {
2568
+ log.error(`Adapter Exception: ${error}`);
2569
+ done(error);
2570
+ }
2925
2571
  }).timeout(attemptTimeout);
2926
2572
  });
2927
2573
 
2928
2574
  describe('#driveTeamdrivesDelete - errors', () => {
2929
2575
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2930
- if (pronghorn.methodsByName.driveTeamdrivesDelete.task) {
2931
- try {
2932
- a.driveTeamdrivesDelete(null, null, null, null, null, null, null, teamdrivesTeamDriveId, (data, error) => {
2933
- try {
2934
- if (stub) {
2935
- const displayE = 'Error 400 received on request';
2936
- runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2937
- } else {
2938
- runCommonAsserts(data, error);
2939
- }
2940
- saveMockData('Teamdrives', 'driveTeamdrivesDelete', 'default', data);
2941
- done();
2942
- } catch (err) {
2943
- log.error(`Test Failure: ${err}`);
2944
- done(err);
2576
+ try {
2577
+ a.driveTeamdrivesDelete(null, null, null, null, null, null, null, teamdrivesTeamDriveId, (data, error) => {
2578
+ try {
2579
+ if (stub) {
2580
+ const displayE = 'Error 400 received on request';
2581
+ runErrorAsserts(data, error, 'AD.500', 'Test-google_drive-connectorRest-handleEndResponse', displayE);
2582
+ } else {
2583
+ runCommonAsserts(data, error);
2945
2584
  }
2946
- });
2947
- } catch (error) {
2948
- log.error(`Adapter Exception: ${error}`);
2949
- done(error);
2950
- }
2951
- } else {
2952
- log.error('driveTeamdrivesDelete task is false, skipping test');
2953
- skipCount += 1;
2954
- done();
2955
- }// end if task
2585
+ saveMockData('Teamdrives', 'driveTeamdrivesDelete', 'default', data);
2586
+ done();
2587
+ } catch (err) {
2588
+ log.error(`Test Failure: ${err}`);
2589
+ done(err);
2590
+ }
2591
+ });
2592
+ } catch (error) {
2593
+ log.error(`Adapter Exception: ${error}`);
2594
+ done(error);
2595
+ }
2956
2596
  }).timeout(attemptTimeout);
2957
2597
  });
2958
-
2959
- describe('#Skipped test count', () => {
2960
- it('count skipped tests', (done) => {
2961
- console.log(`skipped ${skipCount} tests because \x1b[33mtask: false\x1b[0m`);
2962
- done();
2963
- });
2964
- });
2965
2598
  });
2966
2599
  });