@itentialopensource/adapter-jira 1.7.6 → 2.0.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 (70) hide show
  1. package/CALLS.md +8329 -2178
  2. package/CHANGELOG.md +8 -0
  3. package/adapter.js +5582 -0
  4. package/entities/AnnouncementBanner/action.json +45 -0
  5. package/entities/AnnouncementBanner/mockdatafiles/getBanner-default.json +7 -0
  6. package/entities/AnnouncementBanner/schema.json +20 -0
  7. package/entities/AppMigration/action.json +64 -0
  8. package/entities/AppMigration/mockdatafiles/migrationResourceWorkflowRuleSearchPost-default.json +53 -0
  9. package/entities/AppMigration/schema.json +21 -0
  10. package/entities/AppProperties/action.json +126 -0
  11. package/entities/AppProperties/mockdatafiles/addonPropertiesResourceGetAddonPropertiesGet-default.json +8 -0
  12. package/entities/AppProperties/mockdatafiles/addonPropertiesResourceGetAddonPropertyGet-default.json +5 -0
  13. package/entities/AppProperties/mockdatafiles/addonPropertiesResourcePutAddonPropertyPut-default.json +4 -0
  14. package/entities/AppProperties/mockdatafiles/addonPropertiesResourcePutAppPropertyPut-default.json +4 -0
  15. package/entities/AppProperties/schema.json +24 -0
  16. package/entities/Dashboards/action.json +102 -0
  17. package/entities/Dashboards/mockdatafiles/addGadget-default.json +10 -0
  18. package/entities/Dashboards/mockdatafiles/getAllAvailableDashboardGadgets-default.json +12 -0
  19. package/entities/Dashboards/mockdatafiles/getAllGadgets-default.json +34 -0
  20. package/entities/Dashboards/schema.json +6 -1
  21. package/entities/DynamicModules/action.json +65 -0
  22. package/entities/DynamicModules/schema.json +21 -0
  23. package/entities/Filters/action.json +20 -0
  24. package/entities/Filters/schema.json +2 -1
  25. package/entities/Issuefields/action.json +21 -0
  26. package/entities/Issuefields/mockdatafiles/getTrashedFieldsPaginated-default.json +35 -0
  27. package/entities/Issuefields/schema.json +2 -1
  28. package/entities/Issuenotificationschemes/action.json +121 -0
  29. package/entities/Issuenotificationschemes/mockdatafiles/createNotificationScheme-default.json +3 -0
  30. package/entities/Issuenotificationschemes/mockdatafiles/getNotificationSchemeToProjectMappings-default.json +12 -0
  31. package/entities/Issuenotificationschemes/schema.json +7 -1
  32. package/entities/Issuepriorities/action.json +121 -0
  33. package/entities/Issuepriorities/mockdatafiles/createPriority-default.json +3 -0
  34. package/entities/Issuepriorities/mockdatafiles/searchPriorities-default.json +26 -0
  35. package/entities/Issuepriorities/schema.json +7 -1
  36. package/entities/Issueresolutions/action.json +121 -0
  37. package/entities/Issueresolutions/mockdatafiles/createResolution-default.json +3 -0
  38. package/entities/Issueresolutions/mockdatafiles/searchResolutions-default.json +14 -0
  39. package/entities/Issueresolutions/schema.json +7 -1
  40. package/entities/Issuesecurityschemes/action.json +264 -0
  41. package/entities/Issuesecurityschemes/mockdatafiles/createIssueSecurityScheme-default.json +3 -0
  42. package/entities/Issuesecurityschemes/mockdatafiles/getSecurityLevelMembers-default.json +17 -0
  43. package/entities/Issuesecurityschemes/mockdatafiles/getSecurityLevels-default.json +16 -0
  44. package/entities/Issuesecurityschemes/mockdatafiles/searchProjectsUsingSecuritySchemes-default.json +4 -0
  45. package/entities/Issuesecurityschemes/mockdatafiles/searchSecuritySchemes-default.json +10 -0
  46. package/entities/Issuesecurityschemes/schema.json +14 -1
  47. package/entities/JQL/action.json +20 -0
  48. package/entities/JQL/mockdatafiles/sanitiseJqlQueries-default.json +28 -0
  49. package/entities/JQL/schema.json +2 -1
  50. package/entities/JQLFunctionsApps/action.json +45 -0
  51. package/entities/JQLFunctionsApps/mockdatafiles/getPrecomputations-default.json +22 -0
  52. package/entities/JQLFunctionsApps/schema.json +20 -0
  53. package/entities/LicenseMetrics/action.json +46 -0
  54. package/entities/LicenseMetrics/schema.json +20 -0
  55. package/entities/Status/action.json +106 -0
  56. package/entities/Status/mockdatafiles/createStatuses-default.json +15 -0
  57. package/entities/Status/mockdatafiles/getStatusesById-default.json +24 -0
  58. package/entities/Status/mockdatafiles/search-default.json +32 -0
  59. package/entities/Status/schema.json +23 -0
  60. package/entities/UIModificationsApps/action.json +85 -0
  61. package/entities/UIModificationsApps/mockdatafiles/createUiModification-default.json +4 -0
  62. package/entities/UIModificationsApps/mockdatafiles/getUiModifications-default.json +53 -0
  63. package/entities/UIModificationsApps/schema.json +22 -0
  64. package/package.json +1 -1
  65. package/pronghorn.json +4860 -642
  66. package/refs?service=git-upload-pack +0 -0
  67. package/report/adapterInfo.json +7 -7
  68. package/report/jira_v3.json +65406 -0
  69. package/test/integration/adapterTestIntegration.js +1903 -0
  70. package/test/unit/adapterTestUnit.js +2084 -0
@@ -15677,5 +15677,1908 @@ describe('[integration] Jira Adapter Test', () => {
15677
15677
  }
15678
15678
  }).timeout(attemptTimeout);
15679
15679
  });
15680
+
15681
+ describe('#getBanner - errors', () => {
15682
+ it('should work if integrated or standalone with mockdata', (done) => {
15683
+ try {
15684
+ a.getBanner((data, error) => {
15685
+ try {
15686
+ if (stub) {
15687
+ runCommonAsserts(data, error);
15688
+ assert.equal('This is a public, enabled, non-dismissible banner, set using the API', data.response.message);
15689
+ assert.equal(false, data.response.isDismissible);
15690
+ assert.equal(true, data.response.isEnabled);
15691
+ assert.equal('9HN2FJK9DM8BHRWERVW3RRTGDJ4G4D5C', data.response.hashId);
15692
+ assert.equal('public', data.response.visibility);
15693
+ } else {
15694
+ runCommonAsserts(data, error);
15695
+ }
15696
+ saveMockData('AnnouncementBanner', 'getBanner', 'default', data);
15697
+ done();
15698
+ } catch (err) {
15699
+ log.error(`Test Failure: ${err}`);
15700
+ done(err);
15701
+ }
15702
+ });
15703
+ } catch (error) {
15704
+ log.error(`Adapter Exception: ${error}`);
15705
+ done(error);
15706
+ }
15707
+ }).timeout(attemptTimeout);
15708
+ });
15709
+
15710
+ const announcementBannerSetBannerBodyParam = {
15711
+ isDismissible: false,
15712
+ isEnabled: true,
15713
+ message: 'string',
15714
+ visibility: 'string'
15715
+ };
15716
+ describe('#setBanner - errors', () => {
15717
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
15718
+ try {
15719
+ a.setBanner(announcementBannerSetBannerBodyParam, (data, error) => {
15720
+ try {
15721
+ if (stub) {
15722
+ const displayE = 'Error 400 received on request';
15723
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
15724
+ } else {
15725
+ runCommonAsserts(data, error);
15726
+ }
15727
+ saveMockData('AnnouncementBanner', 'setBanner', 'default', data);
15728
+ done();
15729
+ } catch (err) {
15730
+ log.error(`Test Failure: ${err}`);
15731
+ done(err);
15732
+ }
15733
+ });
15734
+ } catch (error) {
15735
+ log.error(`Adapter Exception: ${error}`);
15736
+ done(error);
15737
+ }
15738
+ }).timeout(attemptTimeout);
15739
+ });
15740
+
15741
+ describe('#getAllAvailableDashboardGadgets - errors', () => {
15742
+ it('should work if integrated or standalone with mockdata', (done) => {
15743
+ try {
15744
+ a.getAllAvailableDashboardGadgets((data, error) => {
15745
+ try {
15746
+ if (stub) {
15747
+ runCommonAsserts(data, error);
15748
+ assert.equal(true, Array.isArray(data.response.gadgets));
15749
+ } else {
15750
+ runCommonAsserts(data, error);
15751
+ }
15752
+ saveMockData('Dashboards', 'getAllAvailableDashboardGadgets', 'default', data);
15753
+ done();
15754
+ } catch (err) {
15755
+ log.error(`Test Failure: ${err}`);
15756
+ done(err);
15757
+ }
15758
+ });
15759
+ } catch (error) {
15760
+ log.error(`Adapter Exception: ${error}`);
15761
+ done(error);
15762
+ }
15763
+ }).timeout(attemptTimeout);
15764
+ });
15765
+
15766
+ describe('#getAllGadgets - errors', () => {
15767
+ it('should work if integrated or standalone with mockdata', (done) => {
15768
+ try {
15769
+ a.getAllGadgets(555, null, null, null, (data, error) => {
15770
+ try {
15771
+ if (stub) {
15772
+ runCommonAsserts(data, error);
15773
+ assert.equal(true, Array.isArray(data.response.gadgets));
15774
+ } else {
15775
+ runCommonAsserts(data, error);
15776
+ }
15777
+ saveMockData('Dashboards', 'getAllGadgets', 'default', data);
15778
+ done();
15779
+ } catch (err) {
15780
+ log.error(`Test Failure: ${err}`);
15781
+ done(err);
15782
+ }
15783
+ });
15784
+ } catch (error) {
15785
+ log.error(`Adapter Exception: ${error}`);
15786
+ done(error);
15787
+ }
15788
+ }).timeout(attemptTimeout);
15789
+ });
15790
+
15791
+ const dashboardsAddGadgetBodyParam = {
15792
+ color: 'string',
15793
+ ignoreUriAndModuleKeyValidation: true,
15794
+ moduleKey: 'string',
15795
+ position: {
15796
+ 'The column position of the gadget.': 10,
15797
+ 'The row position of the gadget.': 6
15798
+ },
15799
+ title: 'string',
15800
+ uri: 'string'
15801
+ };
15802
+ describe('#addGadget - errors', () => {
15803
+ it('should work if integrated or standalone with mockdata', (done) => {
15804
+ try {
15805
+ a.addGadget(555, dashboardsAddGadgetBodyParam, (data, error) => {
15806
+ try {
15807
+ if (stub) {
15808
+ runCommonAsserts(data, error);
15809
+ assert.equal(10001, data.response.id);
15810
+ assert.equal('com.atlassian.plugins.atlassian-connect-plugin:com.atlassian.connect.node.sample-addon__sample-dashboard-item', data.response.moduleKey);
15811
+ assert.equal('blue', data.response.color);
15812
+ assert.equal('object', typeof data.response.position);
15813
+ assert.equal('Issue statistics', data.response.title);
15814
+ } else {
15815
+ runCommonAsserts(data, error);
15816
+ }
15817
+ saveMockData('Dashboards', 'addGadget', 'default', data);
15818
+ done();
15819
+ } catch (err) {
15820
+ log.error(`Test Failure: ${err}`);
15821
+ done(err);
15822
+ }
15823
+ });
15824
+ } catch (error) {
15825
+ log.error(`Adapter Exception: ${error}`);
15826
+ done(error);
15827
+ }
15828
+ }).timeout(attemptTimeout);
15829
+ });
15830
+
15831
+ const dashboardsUpdateGadgetBodyParam = {
15832
+ color: 'string',
15833
+ position: {
15834
+ 'The column position of the gadget.': 8,
15835
+ 'The row position of the gadget.': 3
15836
+ },
15837
+ title: 'string'
15838
+ };
15839
+ describe('#updateGadget - errors', () => {
15840
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
15841
+ try {
15842
+ a.updateGadget(555, 555, dashboardsUpdateGadgetBodyParam, (data, error) => {
15843
+ try {
15844
+ if (stub) {
15845
+ const displayE = 'Error 400 received on request';
15846
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
15847
+ } else {
15848
+ runCommonAsserts(data, error);
15849
+ }
15850
+ saveMockData('Dashboards', 'updateGadget', 'default', data);
15851
+ done();
15852
+ } catch (err) {
15853
+ log.error(`Test Failure: ${err}`);
15854
+ done(err);
15855
+ }
15856
+ });
15857
+ } catch (error) {
15858
+ log.error(`Adapter Exception: ${error}`);
15859
+ done(error);
15860
+ }
15861
+ }).timeout(attemptTimeout);
15862
+ });
15863
+
15864
+ describe('#removeGadget - errors', () => {
15865
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
15866
+ try {
15867
+ a.removeGadget(555, 555, (data, error) => {
15868
+ try {
15869
+ if (stub) {
15870
+ const displayE = 'Error 400 received on request';
15871
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
15872
+ } else {
15873
+ runCommonAsserts(data, error);
15874
+ }
15875
+ saveMockData('Dashboards', 'removeGadget', 'default', data);
15876
+ done();
15877
+ } catch (err) {
15878
+ log.error(`Test Failure: ${err}`);
15879
+ done(err);
15880
+ }
15881
+ });
15882
+ } catch (error) {
15883
+ log.error(`Adapter Exception: ${error}`);
15884
+ done(error);
15885
+ }
15886
+ }).timeout(attemptTimeout);
15887
+ });
15888
+
15889
+ describe('#getTrashedFieldsPaginated - errors', () => {
15890
+ it('should work if integrated or standalone with mockdata', (done) => {
15891
+ try {
15892
+ a.getTrashedFieldsPaginated(null, null, null, null, null, null, (data, error) => {
15893
+ try {
15894
+ if (stub) {
15895
+ runCommonAsserts(data, error);
15896
+ assert.equal(50, data.response.maxResults);
15897
+ assert.equal(0, data.response.startAt);
15898
+ assert.equal(1, data.response.total);
15899
+ assert.equal(false, data.response.isLast);
15900
+ assert.equal(true, Array.isArray(data.response.values));
15901
+ } else {
15902
+ runCommonAsserts(data, error);
15903
+ }
15904
+ saveMockData('Issuefields', 'getTrashedFieldsPaginated', 'default', data);
15905
+ done();
15906
+ } catch (err) {
15907
+ log.error(`Test Failure: ${err}`);
15908
+ done(err);
15909
+ }
15910
+ });
15911
+ } catch (error) {
15912
+ log.error(`Adapter Exception: ${error}`);
15913
+ done(error);
15914
+ }
15915
+ }).timeout(attemptTimeout);
15916
+ });
15917
+
15918
+ const filtersChangeFilterOwnerBodyParam = {
15919
+ accountId: 'string'
15920
+ };
15921
+ describe('#changeFilterOwner - errors', () => {
15922
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
15923
+ try {
15924
+ a.changeFilterOwner(555, filtersChangeFilterOwnerBodyParam, (data, error) => {
15925
+ try {
15926
+ if (stub) {
15927
+ const displayE = 'Error 400 received on request';
15928
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
15929
+ } else {
15930
+ runCommonAsserts(data, error);
15931
+ }
15932
+ saveMockData('Filters', 'changeFilterOwner', 'default', data);
15933
+ done();
15934
+ } catch (err) {
15935
+ log.error(`Test Failure: ${err}`);
15936
+ done(err);
15937
+ }
15938
+ });
15939
+ } catch (error) {
15940
+ log.error(`Adapter Exception: ${error}`);
15941
+ done(error);
15942
+ }
15943
+ }).timeout(attemptTimeout);
15944
+ });
15945
+
15946
+ const issueSecuritySchemesCreateIssueSecuritySchemeBodyParam = {
15947
+ name: 'string'
15948
+ };
15949
+ describe('#createIssueSecurityScheme - errors', () => {
15950
+ it('should work if integrated or standalone with mockdata', (done) => {
15951
+ try {
15952
+ a.createIssueSecurityScheme(issueSecuritySchemesCreateIssueSecuritySchemeBodyParam, (data, error) => {
15953
+ try {
15954
+ if (stub) {
15955
+ runCommonAsserts(data, error);
15956
+ assert.equal('10001', data.response.id);
15957
+ } else {
15958
+ runCommonAsserts(data, error);
15959
+ }
15960
+ saveMockData('Issuesecurityschemes', 'createIssueSecurityScheme', 'default', data);
15961
+ done();
15962
+ } catch (err) {
15963
+ log.error(`Test Failure: ${err}`);
15964
+ done(err);
15965
+ }
15966
+ });
15967
+ } catch (error) {
15968
+ log.error(`Adapter Exception: ${error}`);
15969
+ done(error);
15970
+ }
15971
+ }).timeout(attemptTimeout);
15972
+ });
15973
+
15974
+ describe('#getSecurityLevels - errors', () => {
15975
+ it('should work if integrated or standalone with mockdata', (done) => {
15976
+ try {
15977
+ a.getSecurityLevels(null, null, null, null, null, (data, error) => {
15978
+ try {
15979
+ if (stub) {
15980
+ runCommonAsserts(data, error);
15981
+ assert.equal(50, data.response.maxResults);
15982
+ assert.equal(0, data.response.startAt);
15983
+ assert.equal(1, data.response.total);
15984
+ assert.equal(true, data.response.isLast);
15985
+ assert.equal(true, Array.isArray(data.response.values));
15986
+ } else {
15987
+ runCommonAsserts(data, error);
15988
+ }
15989
+ saveMockData('Issuesecurityschemes', 'getSecurityLevels', 'default', data);
15990
+ done();
15991
+ } catch (err) {
15992
+ log.error(`Test Failure: ${err}`);
15993
+ done(err);
15994
+ }
15995
+ });
15996
+ } catch (error) {
15997
+ log.error(`Adapter Exception: ${error}`);
15998
+ done(error);
15999
+ }
16000
+ }).timeout(attemptTimeout);
16001
+ });
16002
+
16003
+ const issueSecuritySchemesSetDefaultLevelsBodyParam = {
16004
+ defaultValues: [
16005
+ {}
16006
+ ]
16007
+ };
16008
+ describe('#setDefaultLevels - errors', () => {
16009
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16010
+ try {
16011
+ a.setDefaultLevels(issueSecuritySchemesSetDefaultLevelsBodyParam, (data, error) => {
16012
+ try {
16013
+ if (stub) {
16014
+ const displayE = 'Error 400 received on request';
16015
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16016
+ } else {
16017
+ runCommonAsserts(data, error);
16018
+ }
16019
+ saveMockData('Issuesecurityschemes', 'setDefaultLevels', 'default', data);
16020
+ done();
16021
+ } catch (err) {
16022
+ log.error(`Test Failure: ${err}`);
16023
+ done(err);
16024
+ }
16025
+ });
16026
+ } catch (error) {
16027
+ log.error(`Adapter Exception: ${error}`);
16028
+ done(error);
16029
+ }
16030
+ }).timeout(attemptTimeout);
16031
+ });
16032
+
16033
+ describe('#getSecurityLevelMembers - errors', () => {
16034
+ it('should work if integrated or standalone with mockdata', (done) => {
16035
+ try {
16036
+ a.getSecurityLevelMembers(null, null, null, null, null, null, (data, error) => {
16037
+ try {
16038
+ if (stub) {
16039
+ runCommonAsserts(data, error);
16040
+ assert.equal(100, data.response.maxResults);
16041
+ assert.equal(0, data.response.startAt);
16042
+ assert.equal(3, data.response.total);
16043
+ assert.equal(true, data.response.isLast);
16044
+ assert.equal(true, Array.isArray(data.response.values));
16045
+ } else {
16046
+ runCommonAsserts(data, error);
16047
+ }
16048
+ saveMockData('Issuesecurityschemes', 'getSecurityLevelMembers', 'default', data);
16049
+ done();
16050
+ } catch (err) {
16051
+ log.error(`Test Failure: ${err}`);
16052
+ done(err);
16053
+ }
16054
+ });
16055
+ } catch (error) {
16056
+ log.error(`Adapter Exception: ${error}`);
16057
+ done(error);
16058
+ }
16059
+ }).timeout(attemptTimeout);
16060
+ });
16061
+
16062
+ describe('#searchProjectsUsingSecuritySchemes - errors', () => {
16063
+ it('should work if integrated or standalone with mockdata', (done) => {
16064
+ try {
16065
+ a.searchProjectsUsingSecuritySchemes(null, null, null, null, (data, error) => {
16066
+ try {
16067
+ if (stub) {
16068
+ runCommonAsserts(data, error);
16069
+ assert.equal('10000', data.response.issueSecuritySchemeId);
16070
+ assert.equal('10000', data.response.projectId);
16071
+ } else {
16072
+ runCommonAsserts(data, error);
16073
+ }
16074
+ saveMockData('Issuesecurityschemes', 'searchProjectsUsingSecuritySchemes', 'default', data);
16075
+ done();
16076
+ } catch (err) {
16077
+ log.error(`Test Failure: ${err}`);
16078
+ done(err);
16079
+ }
16080
+ });
16081
+ } catch (error) {
16082
+ log.error(`Adapter Exception: ${error}`);
16083
+ done(error);
16084
+ }
16085
+ }).timeout(attemptTimeout);
16086
+ });
16087
+
16088
+ describe('#searchSecuritySchemes - errors', () => {
16089
+ it('should work if integrated or standalone with mockdata', (done) => {
16090
+ try {
16091
+ a.searchSecuritySchemes(null, null, null, null, (data, error) => {
16092
+ try {
16093
+ if (stub) {
16094
+ runCommonAsserts(data, error);
16095
+ assert.equal(10000, data.response.id);
16096
+ assert.equal('https://your-domain.atlassian.net/rest/api/3/issuesecurityscheme/10000', data.response.self);
16097
+ assert.equal('Default scheme', data.response.name);
16098
+ assert.equal('Default scheme description', data.response.description);
16099
+ assert.equal(10001, data.response.defaultLevel);
16100
+ assert.equal(true, Array.isArray(data.response.projectIds));
16101
+ } else {
16102
+ runCommonAsserts(data, error);
16103
+ }
16104
+ saveMockData('Issuesecurityschemes', 'searchSecuritySchemes', 'default', data);
16105
+ done();
16106
+ } catch (err) {
16107
+ log.error(`Test Failure: ${err}`);
16108
+ done(err);
16109
+ }
16110
+ });
16111
+ } catch (error) {
16112
+ log.error(`Adapter Exception: ${error}`);
16113
+ done(error);
16114
+ }
16115
+ }).timeout(attemptTimeout);
16116
+ });
16117
+
16118
+ const issueSecuritySchemesUpdateIssueSecuritySchemeBodyParam = {
16119
+ description: 'string',
16120
+ name: 'string'
16121
+ };
16122
+ describe('#updateIssueSecurityScheme - errors', () => {
16123
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16124
+ try {
16125
+ a.updateIssueSecurityScheme('fakedata', issueSecuritySchemesUpdateIssueSecuritySchemeBodyParam, (data, error) => {
16126
+ try {
16127
+ if (stub) {
16128
+ const displayE = 'Error 400 received on request';
16129
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16130
+ } else {
16131
+ runCommonAsserts(data, error);
16132
+ }
16133
+ saveMockData('Issuesecurityschemes', 'updateIssueSecurityScheme', 'default', data);
16134
+ done();
16135
+ } catch (err) {
16136
+ log.error(`Test Failure: ${err}`);
16137
+ done(err);
16138
+ }
16139
+ });
16140
+ } catch (error) {
16141
+ log.error(`Adapter Exception: ${error}`);
16142
+ done(error);
16143
+ }
16144
+ }).timeout(attemptTimeout);
16145
+ });
16146
+
16147
+ describe('#deleteSecurityScheme - errors', () => {
16148
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16149
+ try {
16150
+ a.deleteSecurityScheme('fakedata', (data, error) => {
16151
+ try {
16152
+ if (stub) {
16153
+ const displayE = 'Error 400 received on request';
16154
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16155
+ } else {
16156
+ runCommonAsserts(data, error);
16157
+ }
16158
+ saveMockData('Issuesecurityschemes', 'deleteSecurityScheme', 'default', data);
16159
+ done();
16160
+ } catch (err) {
16161
+ log.error(`Test Failure: ${err}`);
16162
+ done(err);
16163
+ }
16164
+ });
16165
+ } catch (error) {
16166
+ log.error(`Adapter Exception: ${error}`);
16167
+ done(error);
16168
+ }
16169
+ }).timeout(attemptTimeout);
16170
+ });
16171
+
16172
+ const issueSecuritySchemesAddSecurityLevelBodyParam = {
16173
+ levels: [
16174
+ {
16175
+ description: 'string',
16176
+ isDefault: false,
16177
+ members: [
16178
+ {
16179
+ parameter: 'string',
16180
+ type: 'string'
16181
+ }
16182
+ ],
16183
+ name: 'string'
16184
+ }
16185
+ ]
16186
+ };
16187
+ describe('#addSecurityLevel - errors', () => {
16188
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16189
+ try {
16190
+ a.addSecurityLevel('fakedata', issueSecuritySchemesAddSecurityLevelBodyParam, (data, error) => {
16191
+ try {
16192
+ if (stub) {
16193
+ const displayE = 'Error 400 received on request';
16194
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16195
+ } else {
16196
+ runCommonAsserts(data, error);
16197
+ }
16198
+ saveMockData('Issuesecurityschemes', 'addSecurityLevel', 'default', data);
16199
+ done();
16200
+ } catch (err) {
16201
+ log.error(`Test Failure: ${err}`);
16202
+ done(err);
16203
+ }
16204
+ });
16205
+ } catch (error) {
16206
+ log.error(`Adapter Exception: ${error}`);
16207
+ done(error);
16208
+ }
16209
+ }).timeout(attemptTimeout);
16210
+ });
16211
+
16212
+ const issueSecuritySchemesUpdateSecurityLevelBodyParam = {
16213
+ description: 'string',
16214
+ name: 'string'
16215
+ };
16216
+ describe('#updateSecurityLevel - errors', () => {
16217
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16218
+ try {
16219
+ a.updateSecurityLevel('fakedata', 'fakedata', issueSecuritySchemesUpdateSecurityLevelBodyParam, (data, error) => {
16220
+ try {
16221
+ if (stub) {
16222
+ const displayE = 'Error 400 received on request';
16223
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16224
+ } else {
16225
+ runCommonAsserts(data, error);
16226
+ }
16227
+ saveMockData('Issuesecurityschemes', 'updateSecurityLevel', 'default', data);
16228
+ done();
16229
+ } catch (err) {
16230
+ log.error(`Test Failure: ${err}`);
16231
+ done(err);
16232
+ }
16233
+ });
16234
+ } catch (error) {
16235
+ log.error(`Adapter Exception: ${error}`);
16236
+ done(error);
16237
+ }
16238
+ }).timeout(attemptTimeout);
16239
+ });
16240
+
16241
+ describe('#removeLevel - errors', () => {
16242
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16243
+ try {
16244
+ a.removeLevel('fakedata', 'fakedata', null, (data, error) => {
16245
+ try {
16246
+ if (stub) {
16247
+ const displayE = 'Error 400 received on request';
16248
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16249
+ } else {
16250
+ runCommonAsserts(data, error);
16251
+ }
16252
+ saveMockData('Issuesecurityschemes', 'removeLevel', 'default', data);
16253
+ done();
16254
+ } catch (err) {
16255
+ log.error(`Test Failure: ${err}`);
16256
+ done(err);
16257
+ }
16258
+ });
16259
+ } catch (error) {
16260
+ log.error(`Adapter Exception: ${error}`);
16261
+ done(error);
16262
+ }
16263
+ }).timeout(attemptTimeout);
16264
+ });
16265
+
16266
+ const issueSecuritySchemesAddSecurityLevelMembersBodyParam = {};
16267
+ describe('#addSecurityLevelMembers - errors', () => {
16268
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16269
+ try {
16270
+ a.addSecurityLevelMembers('fakedata', 'fakedata', issueSecuritySchemesAddSecurityLevelMembersBodyParam, (data, error) => {
16271
+ try {
16272
+ if (stub) {
16273
+ const displayE = 'Error 400 received on request';
16274
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16275
+ } else {
16276
+ runCommonAsserts(data, error);
16277
+ }
16278
+ saveMockData('Issuesecurityschemes', 'addSecurityLevelMembers', 'default', data);
16279
+ done();
16280
+ } catch (err) {
16281
+ log.error(`Test Failure: ${err}`);
16282
+ done(err);
16283
+ }
16284
+ });
16285
+ } catch (error) {
16286
+ log.error(`Adapter Exception: ${error}`);
16287
+ done(error);
16288
+ }
16289
+ }).timeout(attemptTimeout);
16290
+ });
16291
+
16292
+ describe('#removeMemberFromSecurityLevel - errors', () => {
16293
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16294
+ try {
16295
+ a.removeMemberFromSecurityLevel('fakedata', 'fakedata', 'fakedata', (data, error) => {
16296
+ try {
16297
+ if (stub) {
16298
+ const displayE = 'Error 400 received on request';
16299
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16300
+ } else {
16301
+ runCommonAsserts(data, error);
16302
+ }
16303
+ saveMockData('Issuesecurityschemes', 'removeMemberFromSecurityLevel', 'default', data);
16304
+ done();
16305
+ } catch (err) {
16306
+ log.error(`Test Failure: ${err}`);
16307
+ done(err);
16308
+ }
16309
+ });
16310
+ } catch (error) {
16311
+ log.error(`Adapter Exception: ${error}`);
16312
+ done(error);
16313
+ }
16314
+ }).timeout(attemptTimeout);
16315
+ });
16316
+
16317
+ const jQLSanitiseJqlQueriesBodyParam = {
16318
+ queries: [
16319
+ {}
16320
+ ]
16321
+ };
16322
+ describe('#sanitiseJqlQueries - errors', () => {
16323
+ it('should work if integrated or standalone with mockdata', (done) => {
16324
+ try {
16325
+ a.sanitiseJqlQueries(jQLSanitiseJqlQueriesBodyParam, (data, error) => {
16326
+ try {
16327
+ if (stub) {
16328
+ runCommonAsserts(data, error);
16329
+ assert.equal(true, Array.isArray(data.response.queries));
16330
+ } else {
16331
+ runCommonAsserts(data, error);
16332
+ }
16333
+ saveMockData('JQL', 'sanitiseJqlQueries', 'default', data);
16334
+ done();
16335
+ } catch (err) {
16336
+ log.error(`Test Failure: ${err}`);
16337
+ done(err);
16338
+ }
16339
+ });
16340
+ } catch (error) {
16341
+ log.error(`Adapter Exception: ${error}`);
16342
+ done(error);
16343
+ }
16344
+ }).timeout(attemptTimeout);
16345
+ });
16346
+
16347
+ describe('#getPrecomputations - errors', () => {
16348
+ it('should work if integrated or standalone with mockdata', (done) => {
16349
+ try {
16350
+ a.getPrecomputations(null, null, null, null, null, (data, error) => {
16351
+ try {
16352
+ if (stub) {
16353
+ runCommonAsserts(data, error);
16354
+ assert.equal(100, data.response.maxResults);
16355
+ assert.equal(0, data.response.startAt);
16356
+ assert.equal(1, data.response.total);
16357
+ assert.equal(true, data.response.isLast);
16358
+ assert.equal(true, Array.isArray(data.response.values));
16359
+ } else {
16360
+ runCommonAsserts(data, error);
16361
+ }
16362
+ saveMockData('JQLFunctionsApps', 'getPrecomputations', 'default', data);
16363
+ done();
16364
+ } catch (err) {
16365
+ log.error(`Test Failure: ${err}`);
16366
+ done(err);
16367
+ }
16368
+ });
16369
+ } catch (error) {
16370
+ log.error(`Adapter Exception: ${error}`);
16371
+ done(error);
16372
+ }
16373
+ }).timeout(attemptTimeout);
16374
+ });
16375
+
16376
+ const jQLFunctionsAppsUpdatePrecomputationsBodyParam = {
16377
+ values: [
16378
+ {
16379
+ id: 1,
16380
+ value: 'string'
16381
+ }
16382
+ ]
16383
+ };
16384
+ describe('#updatePrecomputations - errors', () => {
16385
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16386
+ try {
16387
+ a.updatePrecomputations(jQLFunctionsAppsUpdatePrecomputationsBodyParam, (data, error) => {
16388
+ try {
16389
+ if (stub) {
16390
+ const displayE = 'Error 400 received on request';
16391
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16392
+ } else {
16393
+ runCommonAsserts(data, error);
16394
+ }
16395
+ saveMockData('JQLFunctionsApps', 'updatePrecomputations', 'default', data);
16396
+ done();
16397
+ } catch (err) {
16398
+ log.error(`Test Failure: ${err}`);
16399
+ done(err);
16400
+ }
16401
+ });
16402
+ } catch (error) {
16403
+ log.error(`Adapter Exception: ${error}`);
16404
+ done(error);
16405
+ }
16406
+ }).timeout(attemptTimeout);
16407
+ });
16408
+
16409
+ describe('#getApproximateLicenseCount - errors', () => {
16410
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16411
+ try {
16412
+ a.getApproximateLicenseCount((data, error) => {
16413
+ try {
16414
+ if (stub) {
16415
+ const displayE = 'Error 400 received on request';
16416
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16417
+ } else {
16418
+ runCommonAsserts(data, error);
16419
+ }
16420
+ saveMockData('LicenseMetrics', 'getApproximateLicenseCount', 'default', data);
16421
+ done();
16422
+ } catch (err) {
16423
+ log.error(`Test Failure: ${err}`);
16424
+ done(err);
16425
+ }
16426
+ });
16427
+ } catch (error) {
16428
+ log.error(`Adapter Exception: ${error}`);
16429
+ done(error);
16430
+ }
16431
+ }).timeout(attemptTimeout);
16432
+ });
16433
+
16434
+ describe('#getApproximateApplicationLicenseCount - errors', () => {
16435
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16436
+ try {
16437
+ a.getApproximateApplicationLicenseCount('fakedata', (data, error) => {
16438
+ try {
16439
+ if (stub) {
16440
+ const displayE = 'Error 400 received on request';
16441
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16442
+ } else {
16443
+ runCommonAsserts(data, error);
16444
+ }
16445
+ saveMockData('LicenseMetrics', 'getApproximateApplicationLicenseCount', 'default', data);
16446
+ done();
16447
+ } catch (err) {
16448
+ log.error(`Test Failure: ${err}`);
16449
+ done(err);
16450
+ }
16451
+ });
16452
+ } catch (error) {
16453
+ log.error(`Adapter Exception: ${error}`);
16454
+ done(error);
16455
+ }
16456
+ }).timeout(attemptTimeout);
16457
+ });
16458
+
16459
+ const issueNotificationSchemesCreateNotificationSchemeBodyParam = {
16460
+ name: 'string'
16461
+ };
16462
+ describe('#createNotificationScheme - errors', () => {
16463
+ it('should work if integrated or standalone with mockdata', (done) => {
16464
+ try {
16465
+ a.createNotificationScheme(issueNotificationSchemesCreateNotificationSchemeBodyParam, (data, error) => {
16466
+ try {
16467
+ if (stub) {
16468
+ runCommonAsserts(data, error);
16469
+ assert.equal('10001', data.response.id);
16470
+ } else {
16471
+ runCommonAsserts(data, error);
16472
+ }
16473
+ saveMockData('Issuenotificationschemes', 'createNotificationScheme', 'default', data);
16474
+ done();
16475
+ } catch (err) {
16476
+ log.error(`Test Failure: ${err}`);
16477
+ done(err);
16478
+ }
16479
+ });
16480
+ } catch (error) {
16481
+ log.error(`Adapter Exception: ${error}`);
16482
+ done(error);
16483
+ }
16484
+ }).timeout(attemptTimeout);
16485
+ });
16486
+
16487
+ describe('#getNotificationSchemeToProjectMappings - errors', () => {
16488
+ it('should work if integrated or standalone with mockdata', (done) => {
16489
+ try {
16490
+ a.getNotificationSchemeToProjectMappings(null, null, null, null, (data, error) => {
16491
+ try {
16492
+ if (stub) {
16493
+ runCommonAsserts(data, error);
16494
+ assert.equal(50, data.response.maxResults);
16495
+ assert.equal(0, data.response.startAt);
16496
+ assert.equal(4, data.response.total);
16497
+ assert.equal(true, data.response.isLast);
16498
+ assert.equal(true, Array.isArray(data.response.values));
16499
+ } else {
16500
+ runCommonAsserts(data, error);
16501
+ }
16502
+ saveMockData('Issuenotificationschemes', 'getNotificationSchemeToProjectMappings', 'default', data);
16503
+ done();
16504
+ } catch (err) {
16505
+ log.error(`Test Failure: ${err}`);
16506
+ done(err);
16507
+ }
16508
+ });
16509
+ } catch (error) {
16510
+ log.error(`Adapter Exception: ${error}`);
16511
+ done(error);
16512
+ }
16513
+ }).timeout(attemptTimeout);
16514
+ });
16515
+
16516
+ const issueNotificationSchemesUpdateNotificationSchemeBodyParam = {
16517
+ description: 'string',
16518
+ name: 'string'
16519
+ };
16520
+ describe('#updateNotificationScheme - errors', () => {
16521
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16522
+ try {
16523
+ a.updateNotificationScheme('fakedata', issueNotificationSchemesUpdateNotificationSchemeBodyParam, (data, error) => {
16524
+ try {
16525
+ if (stub) {
16526
+ const displayE = 'Error 400 received on request';
16527
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16528
+ } else {
16529
+ runCommonAsserts(data, error);
16530
+ }
16531
+ saveMockData('Issuenotificationschemes', 'updateNotificationScheme', 'default', data);
16532
+ done();
16533
+ } catch (err) {
16534
+ log.error(`Test Failure: ${err}`);
16535
+ done(err);
16536
+ }
16537
+ });
16538
+ } catch (error) {
16539
+ log.error(`Adapter Exception: ${error}`);
16540
+ done(error);
16541
+ }
16542
+ }).timeout(attemptTimeout);
16543
+ });
16544
+
16545
+ const issueNotificationSchemesAddNotificationsBodyParam = {
16546
+ notificationSchemeEvents: [
16547
+ {}
16548
+ ]
16549
+ };
16550
+ describe('#addNotifications - errors', () => {
16551
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16552
+ try {
16553
+ a.addNotifications('fakedata', issueNotificationSchemesAddNotificationsBodyParam, (data, error) => {
16554
+ try {
16555
+ if (stub) {
16556
+ const displayE = 'Error 400 received on request';
16557
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16558
+ } else {
16559
+ runCommonAsserts(data, error);
16560
+ }
16561
+ saveMockData('Issuenotificationschemes', 'addNotifications', 'default', data);
16562
+ done();
16563
+ } catch (err) {
16564
+ log.error(`Test Failure: ${err}`);
16565
+ done(err);
16566
+ }
16567
+ });
16568
+ } catch (error) {
16569
+ log.error(`Adapter Exception: ${error}`);
16570
+ done(error);
16571
+ }
16572
+ }).timeout(attemptTimeout);
16573
+ });
16574
+
16575
+ describe('#deleteNotificationScheme - errors', () => {
16576
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16577
+ try {
16578
+ a.deleteNotificationScheme('fakedata', (data, error) => {
16579
+ try {
16580
+ if (stub) {
16581
+ const displayE = 'Error 400 received on request';
16582
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16583
+ } else {
16584
+ runCommonAsserts(data, error);
16585
+ }
16586
+ saveMockData('Issuenotificationschemes', 'deleteNotificationScheme', 'default', data);
16587
+ done();
16588
+ } catch (err) {
16589
+ log.error(`Test Failure: ${err}`);
16590
+ done(err);
16591
+ }
16592
+ });
16593
+ } catch (error) {
16594
+ log.error(`Adapter Exception: ${error}`);
16595
+ done(error);
16596
+ }
16597
+ }).timeout(attemptTimeout);
16598
+ });
16599
+
16600
+ describe('#removeNotificationFromNotificationScheme - errors', () => {
16601
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16602
+ try {
16603
+ a.removeNotificationFromNotificationScheme('fakedata', 'fakedata', (data, error) => {
16604
+ try {
16605
+ if (stub) {
16606
+ const displayE = 'Error 400 received on request';
16607
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16608
+ } else {
16609
+ runCommonAsserts(data, error);
16610
+ }
16611
+ saveMockData('Issuenotificationschemes', 'removeNotificationFromNotificationScheme', 'default', data);
16612
+ done();
16613
+ } catch (err) {
16614
+ log.error(`Test Failure: ${err}`);
16615
+ done(err);
16616
+ }
16617
+ });
16618
+ } catch (error) {
16619
+ log.error(`Adapter Exception: ${error}`);
16620
+ done(error);
16621
+ }
16622
+ }).timeout(attemptTimeout);
16623
+ });
16624
+
16625
+ const issuePrioritiesCreatePriorityBodyParam = {
16626
+ name: 'string',
16627
+ statusColor: 'string'
16628
+ };
16629
+ describe('#createPriority - errors', () => {
16630
+ it('should work if integrated or standalone with mockdata', (done) => {
16631
+ try {
16632
+ a.createPriority(issuePrioritiesCreatePriorityBodyParam, (data, error) => {
16633
+ try {
16634
+ if (stub) {
16635
+ runCommonAsserts(data, error);
16636
+ assert.equal('10001', data.response.id);
16637
+ } else {
16638
+ runCommonAsserts(data, error);
16639
+ }
16640
+ saveMockData('Issuepriorities', 'createPriority', 'default', data);
16641
+ done();
16642
+ } catch (err) {
16643
+ log.error(`Test Failure: ${err}`);
16644
+ done(err);
16645
+ }
16646
+ });
16647
+ } catch (error) {
16648
+ log.error(`Adapter Exception: ${error}`);
16649
+ done(error);
16650
+ }
16651
+ }).timeout(attemptTimeout);
16652
+ });
16653
+
16654
+ const issuePrioritiesSetDefaultPriorityBodyParam = {
16655
+ id: 'string'
16656
+ };
16657
+ describe('#setDefaultPriority - errors', () => {
16658
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16659
+ try {
16660
+ a.setDefaultPriority(issuePrioritiesSetDefaultPriorityBodyParam, (data, error) => {
16661
+ try {
16662
+ if (stub) {
16663
+ const displayE = 'Error 400 received on request';
16664
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16665
+ } else {
16666
+ runCommonAsserts(data, error);
16667
+ }
16668
+ saveMockData('Issuepriorities', 'setDefaultPriority', 'default', data);
16669
+ done();
16670
+ } catch (err) {
16671
+ log.error(`Test Failure: ${err}`);
16672
+ done(err);
16673
+ }
16674
+ });
16675
+ } catch (error) {
16676
+ log.error(`Adapter Exception: ${error}`);
16677
+ done(error);
16678
+ }
16679
+ }).timeout(attemptTimeout);
16680
+ });
16681
+
16682
+ const issuePrioritiesMovePrioritiesBodyParam = {
16683
+ ids: [
16684
+ 'string'
16685
+ ]
16686
+ };
16687
+ describe('#movePriorities - errors', () => {
16688
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16689
+ try {
16690
+ a.movePriorities(issuePrioritiesMovePrioritiesBodyParam, (data, error) => {
16691
+ try {
16692
+ if (stub) {
16693
+ const displayE = 'Error 400 received on request';
16694
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16695
+ } else {
16696
+ runCommonAsserts(data, error);
16697
+ }
16698
+ saveMockData('Issuepriorities', 'movePriorities', 'default', data);
16699
+ done();
16700
+ } catch (err) {
16701
+ log.error(`Test Failure: ${err}`);
16702
+ done(err);
16703
+ }
16704
+ });
16705
+ } catch (error) {
16706
+ log.error(`Adapter Exception: ${error}`);
16707
+ done(error);
16708
+ }
16709
+ }).timeout(attemptTimeout);
16710
+ });
16711
+
16712
+ describe('#searchPriorities - errors', () => {
16713
+ it('should work if integrated or standalone with mockdata', (done) => {
16714
+ try {
16715
+ a.searchPriorities(null, null, null, null, (data, error) => {
16716
+ try {
16717
+ if (stub) {
16718
+ runCommonAsserts(data, error);
16719
+ assert.equal(50, data.response.maxResults);
16720
+ assert.equal(0, data.response.startAt);
16721
+ assert.equal(2, data.response.total);
16722
+ assert.equal(true, data.response.isLast);
16723
+ assert.equal(true, Array.isArray(data.response.values));
16724
+ } else {
16725
+ runCommonAsserts(data, error);
16726
+ }
16727
+ saveMockData('Issuepriorities', 'searchPriorities', 'default', data);
16728
+ done();
16729
+ } catch (err) {
16730
+ log.error(`Test Failure: ${err}`);
16731
+ done(err);
16732
+ }
16733
+ });
16734
+ } catch (error) {
16735
+ log.error(`Adapter Exception: ${error}`);
16736
+ done(error);
16737
+ }
16738
+ }).timeout(attemptTimeout);
16739
+ });
16740
+
16741
+ const issuePrioritiesUpdatePriorityBodyParam = {
16742
+ description: 'string',
16743
+ iconUrl: '/images/icons/priorities/medium.png',
16744
+ name: 'string',
16745
+ statusColor: 'string'
16746
+ };
16747
+ describe('#updatePriority - errors', () => {
16748
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16749
+ try {
16750
+ a.updatePriority('fakedata', issuePrioritiesUpdatePriorityBodyParam, (data, error) => {
16751
+ try {
16752
+ if (stub) {
16753
+ const displayE = 'Error 400 received on request';
16754
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16755
+ } else {
16756
+ runCommonAsserts(data, error);
16757
+ }
16758
+ saveMockData('Issuepriorities', 'updatePriority', 'default', data);
16759
+ done();
16760
+ } catch (err) {
16761
+ log.error(`Test Failure: ${err}`);
16762
+ done(err);
16763
+ }
16764
+ });
16765
+ } catch (error) {
16766
+ log.error(`Adapter Exception: ${error}`);
16767
+ done(error);
16768
+ }
16769
+ }).timeout(attemptTimeout);
16770
+ });
16771
+
16772
+ describe('#deletePriority - errors', () => {
16773
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16774
+ try {
16775
+ a.deletePriority('fakedata', 'fakedata', (data, error) => {
16776
+ try {
16777
+ if (stub) {
16778
+ const displayE = 'Error 400 received on request';
16779
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16780
+ } else {
16781
+ runCommonAsserts(data, error);
16782
+ }
16783
+ saveMockData('Issuepriorities', 'deletePriority', 'default', data);
16784
+ done();
16785
+ } catch (err) {
16786
+ log.error(`Test Failure: ${err}`);
16787
+ done(err);
16788
+ }
16789
+ });
16790
+ } catch (error) {
16791
+ log.error(`Adapter Exception: ${error}`);
16792
+ done(error);
16793
+ }
16794
+ }).timeout(attemptTimeout);
16795
+ });
16796
+
16797
+ const issueResolutionsCreateResolutionBodyParam = {
16798
+ name: 'string'
16799
+ };
16800
+ describe('#createResolution - errors', () => {
16801
+ it('should work if integrated or standalone with mockdata', (done) => {
16802
+ try {
16803
+ a.createResolution(issueResolutionsCreateResolutionBodyParam, (data, error) => {
16804
+ try {
16805
+ if (stub) {
16806
+ runCommonAsserts(data, error);
16807
+ assert.equal('10001', data.response.id);
16808
+ } else {
16809
+ runCommonAsserts(data, error);
16810
+ }
16811
+ saveMockData('Issueresolutions', 'createResolution', 'default', data);
16812
+ done();
16813
+ } catch (err) {
16814
+ log.error(`Test Failure: ${err}`);
16815
+ done(err);
16816
+ }
16817
+ });
16818
+ } catch (error) {
16819
+ log.error(`Adapter Exception: ${error}`);
16820
+ done(error);
16821
+ }
16822
+ }).timeout(attemptTimeout);
16823
+ });
16824
+
16825
+ const issueResolutionsSetDefaultResolutionBodyParam = {
16826
+ id: 'string'
16827
+ };
16828
+ describe('#setDefaultResolution - errors', () => {
16829
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16830
+ try {
16831
+ a.setDefaultResolution(issueResolutionsSetDefaultResolutionBodyParam, (data, error) => {
16832
+ try {
16833
+ if (stub) {
16834
+ const displayE = 'Error 400 received on request';
16835
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16836
+ } else {
16837
+ runCommonAsserts(data, error);
16838
+ }
16839
+ saveMockData('Issueresolutions', 'setDefaultResolution', 'default', data);
16840
+ done();
16841
+ } catch (err) {
16842
+ log.error(`Test Failure: ${err}`);
16843
+ done(err);
16844
+ }
16845
+ });
16846
+ } catch (error) {
16847
+ log.error(`Adapter Exception: ${error}`);
16848
+ done(error);
16849
+ }
16850
+ }).timeout(attemptTimeout);
16851
+ });
16852
+
16853
+ const issueResolutionsMoveResolutionsBodyParam = {
16854
+ ids: [
16855
+ 'string'
16856
+ ]
16857
+ };
16858
+ describe('#moveResolutions - errors', () => {
16859
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16860
+ try {
16861
+ a.moveResolutions(issueResolutionsMoveResolutionsBodyParam, (data, error) => {
16862
+ try {
16863
+ if (stub) {
16864
+ const displayE = 'Error 400 received on request';
16865
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16866
+ } else {
16867
+ runCommonAsserts(data, error);
16868
+ }
16869
+ saveMockData('Issueresolutions', 'moveResolutions', 'default', data);
16870
+ done();
16871
+ } catch (err) {
16872
+ log.error(`Test Failure: ${err}`);
16873
+ done(err);
16874
+ }
16875
+ });
16876
+ } catch (error) {
16877
+ log.error(`Adapter Exception: ${error}`);
16878
+ done(error);
16879
+ }
16880
+ }).timeout(attemptTimeout);
16881
+ });
16882
+
16883
+ describe('#searchResolutions - errors', () => {
16884
+ it('should work if integrated or standalone with mockdata', (done) => {
16885
+ try {
16886
+ a.searchResolutions(null, null, null, null, (data, error) => {
16887
+ try {
16888
+ if (stub) {
16889
+ runCommonAsserts(data, error);
16890
+ assert.equal(50, data.response.maxResults);
16891
+ assert.equal(0, data.response.startAt);
16892
+ assert.equal(1, data.response.total);
16893
+ assert.equal(true, data.response.isLast);
16894
+ assert.equal(true, Array.isArray(data.response.values));
16895
+ } else {
16896
+ runCommonAsserts(data, error);
16897
+ }
16898
+ saveMockData('Issueresolutions', 'searchResolutions', 'default', data);
16899
+ done();
16900
+ } catch (err) {
16901
+ log.error(`Test Failure: ${err}`);
16902
+ done(err);
16903
+ }
16904
+ });
16905
+ } catch (error) {
16906
+ log.error(`Adapter Exception: ${error}`);
16907
+ done(error);
16908
+ }
16909
+ }).timeout(attemptTimeout);
16910
+ });
16911
+
16912
+ const issueResolutionsUpdateResolutionBodyParam = {
16913
+ name: 'string'
16914
+ };
16915
+ describe('#updateResolution - errors', () => {
16916
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16917
+ try {
16918
+ a.updateResolution('fakedata', issueResolutionsUpdateResolutionBodyParam, (data, error) => {
16919
+ try {
16920
+ if (stub) {
16921
+ const displayE = 'Error 400 received on request';
16922
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16923
+ } else {
16924
+ runCommonAsserts(data, error);
16925
+ }
16926
+ saveMockData('Issueresolutions', 'updateResolution', 'default', data);
16927
+ done();
16928
+ } catch (err) {
16929
+ log.error(`Test Failure: ${err}`);
16930
+ done(err);
16931
+ }
16932
+ });
16933
+ } catch (error) {
16934
+ log.error(`Adapter Exception: ${error}`);
16935
+ done(error);
16936
+ }
16937
+ }).timeout(attemptTimeout);
16938
+ });
16939
+
16940
+ describe('#deleteResolution - errors', () => {
16941
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
16942
+ try {
16943
+ a.deleteResolution('fakedata', 'fakedata', (data, error) => {
16944
+ try {
16945
+ if (stub) {
16946
+ const displayE = 'Error 400 received on request';
16947
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
16948
+ } else {
16949
+ runCommonAsserts(data, error);
16950
+ }
16951
+ saveMockData('Issueresolutions', 'deleteResolution', 'default', data);
16952
+ done();
16953
+ } catch (err) {
16954
+ log.error(`Test Failure: ${err}`);
16955
+ done(err);
16956
+ }
16957
+ });
16958
+ } catch (error) {
16959
+ log.error(`Adapter Exception: ${error}`);
16960
+ done(error);
16961
+ }
16962
+ }).timeout(attemptTimeout);
16963
+ });
16964
+
16965
+ describe('#getStatusesById - errors', () => {
16966
+ it('should work if integrated or standalone with mockdata', (done) => {
16967
+ try {
16968
+ a.getStatusesById(null, null, (data, error) => {
16969
+ try {
16970
+ if (stub) {
16971
+ runCommonAsserts(data, error);
16972
+ assert.equal('object', typeof data.response[0]);
16973
+ } else {
16974
+ runCommonAsserts(data, error);
16975
+ }
16976
+ saveMockData('Status', 'getStatusesById', 'default', data);
16977
+ done();
16978
+ } catch (err) {
16979
+ log.error(`Test Failure: ${err}`);
16980
+ done(err);
16981
+ }
16982
+ });
16983
+ } catch (error) {
16984
+ log.error(`Adapter Exception: ${error}`);
16985
+ done(error);
16986
+ }
16987
+ }).timeout(attemptTimeout);
16988
+ });
16989
+
16990
+ const statusUpdateStatusesBodyParam = {
16991
+ statuses: [
16992
+ {
16993
+ description: 'string',
16994
+ id: 'string',
16995
+ name: 'string',
16996
+ statusCategory: 'DONE'
16997
+ }
16998
+ ]
16999
+ };
17000
+ describe('#updateStatuses - errors', () => {
17001
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
17002
+ try {
17003
+ a.updateStatuses(statusUpdateStatusesBodyParam, (data, error) => {
17004
+ try {
17005
+ if (stub) {
17006
+ const displayE = 'Error 400 received on request';
17007
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
17008
+ } else {
17009
+ runCommonAsserts(data, error);
17010
+ }
17011
+ saveMockData('Status', 'updateStatuses', 'default', data);
17012
+ done();
17013
+ } catch (err) {
17014
+ log.error(`Test Failure: ${err}`);
17015
+ done(err);
17016
+ }
17017
+ });
17018
+ } catch (error) {
17019
+ log.error(`Adapter Exception: ${error}`);
17020
+ done(error);
17021
+ }
17022
+ }).timeout(attemptTimeout);
17023
+ });
17024
+
17025
+ const statusCreateStatusesBodyParam = {
17026
+ scope: {},
17027
+ statuses: [
17028
+ {}
17029
+ ]
17030
+ };
17031
+ describe('#createStatuses - errors', () => {
17032
+ it('should work if integrated or standalone with mockdata', (done) => {
17033
+ try {
17034
+ a.createStatuses(statusCreateStatusesBodyParam, (data, error) => {
17035
+ try {
17036
+ if (stub) {
17037
+ runCommonAsserts(data, error);
17038
+ assert.equal('object', typeof data.response[0]);
17039
+ } else {
17040
+ runCommonAsserts(data, error);
17041
+ }
17042
+ saveMockData('Status', 'createStatuses', 'default', data);
17043
+ done();
17044
+ } catch (err) {
17045
+ log.error(`Test Failure: ${err}`);
17046
+ done(err);
17047
+ }
17048
+ });
17049
+ } catch (error) {
17050
+ log.error(`Adapter Exception: ${error}`);
17051
+ done(error);
17052
+ }
17053
+ }).timeout(attemptTimeout);
17054
+ });
17055
+
17056
+ describe('#deleteStatusesById - errors', () => {
17057
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
17058
+ try {
17059
+ a.deleteStatusesById(null, (data, error) => {
17060
+ try {
17061
+ if (stub) {
17062
+ const displayE = 'Error 400 received on request';
17063
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
17064
+ } else {
17065
+ runCommonAsserts(data, error);
17066
+ }
17067
+ saveMockData('Status', 'deleteStatusesById', 'default', data);
17068
+ done();
17069
+ } catch (err) {
17070
+ log.error(`Test Failure: ${err}`);
17071
+ done(err);
17072
+ }
17073
+ });
17074
+ } catch (error) {
17075
+ log.error(`Adapter Exception: ${error}`);
17076
+ done(error);
17077
+ }
17078
+ }).timeout(attemptTimeout);
17079
+ });
17080
+
17081
+ describe('#search - errors', () => {
17082
+ it('should work if integrated or standalone with mockdata', (done) => {
17083
+ try {
17084
+ a.search(null, null, null, null, null, null, (data, error) => {
17085
+ try {
17086
+ if (stub) {
17087
+ runCommonAsserts(data, error);
17088
+ assert.equal('https://your-domain.atlassian.net/rest/api/3/statuses/search?startAt=0&maxResults=2', data.response.self);
17089
+ assert.equal('https://your-domain.atlassian.net/rest/api/3/statuses/search?startAt=2&maxResults=2', data.response.nextPage);
17090
+ assert.equal(2, data.response.maxResults);
17091
+ assert.equal(0, data.response.startAt);
17092
+ assert.equal(5, data.response.total);
17093
+ assert.equal(true, data.response.isLast);
17094
+ assert.equal(true, Array.isArray(data.response.values));
17095
+ } else {
17096
+ runCommonAsserts(data, error);
17097
+ }
17098
+ saveMockData('Status', 'search', 'default', data);
17099
+ done();
17100
+ } catch (err) {
17101
+ log.error(`Test Failure: ${err}`);
17102
+ done(err);
17103
+ }
17104
+ });
17105
+ } catch (error) {
17106
+ log.error(`Adapter Exception: ${error}`);
17107
+ done(error);
17108
+ }
17109
+ }).timeout(attemptTimeout);
17110
+ });
17111
+
17112
+ describe('#getUiModifications - errors', () => {
17113
+ it('should work if integrated or standalone with mockdata', (done) => {
17114
+ try {
17115
+ a.getUiModifications(null, null, null, (data, error) => {
17116
+ try {
17117
+ if (stub) {
17118
+ runCommonAsserts(data, error);
17119
+ assert.equal(100, data.response.maxResults);
17120
+ assert.equal(0, data.response.startAt);
17121
+ assert.equal(3, data.response.total);
17122
+ assert.equal(true, data.response.isLast);
17123
+ assert.equal(true, Array.isArray(data.response.values));
17124
+ } else {
17125
+ runCommonAsserts(data, error);
17126
+ }
17127
+ saveMockData('UIModificationsApps', 'getUiModifications', 'default', data);
17128
+ done();
17129
+ } catch (err) {
17130
+ log.error(`Test Failure: ${err}`);
17131
+ done(err);
17132
+ }
17133
+ });
17134
+ } catch (error) {
17135
+ log.error(`Adapter Exception: ${error}`);
17136
+ done(error);
17137
+ }
17138
+ }).timeout(attemptTimeout);
17139
+ });
17140
+
17141
+ const uIModificationsAppsCreateUiModificationBodyParam = {
17142
+ name: 'string'
17143
+ };
17144
+ describe('#createUiModification - errors', () => {
17145
+ it('should work if integrated or standalone with mockdata', (done) => {
17146
+ try {
17147
+ a.createUiModification(uIModificationsAppsCreateUiModificationBodyParam, (data, error) => {
17148
+ try {
17149
+ if (stub) {
17150
+ runCommonAsserts(data, error);
17151
+ assert.equal('d7dbda8a-6239-4b63-8e13-a5ef975c8e61', data.response.id);
17152
+ assert.equal('https://api.atlassian.com/ex/jira/{cloudid}/rest/api/2/uiModifications/d7dbda8a-6239-4b63-8e13-a5ef975c8e61', data.response.self);
17153
+ } else {
17154
+ runCommonAsserts(data, error);
17155
+ }
17156
+ saveMockData('UIModificationsApps', 'createUiModification', 'default', data);
17157
+ done();
17158
+ } catch (err) {
17159
+ log.error(`Test Failure: ${err}`);
17160
+ done(err);
17161
+ }
17162
+ });
17163
+ } catch (error) {
17164
+ log.error(`Adapter Exception: ${error}`);
17165
+ done(error);
17166
+ }
17167
+ }).timeout(attemptTimeout);
17168
+ });
17169
+
17170
+ const uIModificationsAppsUpdateUiModificationBodyParam = {
17171
+ contexts: [
17172
+ {
17173
+ id: 'string',
17174
+ isAvailable: true,
17175
+ issueTypeId: 'string',
17176
+ projectId: 'string',
17177
+ viewType: 'string'
17178
+ }
17179
+ ],
17180
+ data: 'string',
17181
+ description: 'string',
17182
+ name: 'string'
17183
+ };
17184
+ describe('#updateUiModification - errors', () => {
17185
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
17186
+ try {
17187
+ a.updateUiModification('fakedata', uIModificationsAppsUpdateUiModificationBodyParam, (data, error) => {
17188
+ try {
17189
+ if (stub) {
17190
+ const displayE = 'Error 400 received on request';
17191
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
17192
+ } else {
17193
+ runCommonAsserts(data, error);
17194
+ }
17195
+ saveMockData('UIModificationsApps', 'updateUiModification', 'default', data);
17196
+ done();
17197
+ } catch (err) {
17198
+ log.error(`Test Failure: ${err}`);
17199
+ done(err);
17200
+ }
17201
+ });
17202
+ } catch (error) {
17203
+ log.error(`Adapter Exception: ${error}`);
17204
+ done(error);
17205
+ }
17206
+ }).timeout(attemptTimeout);
17207
+ });
17208
+
17209
+ describe('#deleteUiModification - errors', () => {
17210
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
17211
+ try {
17212
+ a.deleteUiModification('fakedata', (data, error) => {
17213
+ try {
17214
+ if (stub) {
17215
+ const displayE = 'Error 400 received on request';
17216
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
17217
+ } else {
17218
+ runCommonAsserts(data, error);
17219
+ }
17220
+ saveMockData('UIModificationsApps', 'deleteUiModification', 'default', data);
17221
+ done();
17222
+ } catch (err) {
17223
+ log.error(`Test Failure: ${err}`);
17224
+ done(err);
17225
+ }
17226
+ });
17227
+ } catch (error) {
17228
+ log.error(`Adapter Exception: ${error}`);
17229
+ done(error);
17230
+ }
17231
+ }).timeout(attemptTimeout);
17232
+ });
17233
+
17234
+ describe('#addonPropertiesResourceGetAddonPropertiesGet - errors', () => {
17235
+ it('should work if integrated or standalone with mockdata', (done) => {
17236
+ try {
17237
+ a.addonPropertiesResourceGetAddonPropertiesGet('fakedata', (data, error) => {
17238
+ try {
17239
+ if (stub) {
17240
+ runCommonAsserts(data, error);
17241
+ assert.equal(true, Array.isArray(data.response.keys));
17242
+ } else {
17243
+ runCommonAsserts(data, error);
17244
+ }
17245
+ saveMockData('AppProperties', 'addonPropertiesResourceGetAddonPropertiesGet', 'default', data);
17246
+ done();
17247
+ } catch (err) {
17248
+ log.error(`Test Failure: ${err}`);
17249
+ done(err);
17250
+ }
17251
+ });
17252
+ } catch (error) {
17253
+ log.error(`Adapter Exception: ${error}`);
17254
+ done(error);
17255
+ }
17256
+ }).timeout(attemptTimeout);
17257
+ });
17258
+
17259
+ describe('#addonPropertiesResourceGetAddonPropertyGet - errors', () => {
17260
+ it('should work if integrated or standalone with mockdata', (done) => {
17261
+ try {
17262
+ a.addonPropertiesResourceGetAddonPropertyGet('fakedata', 'fakedata', (data, error) => {
17263
+ try {
17264
+ if (stub) {
17265
+ runCommonAsserts(data, error);
17266
+ assert.equal('https://your-domain.atlassian.net/jira/rest/atlassian-connect/1/addon/example.app.key/properties/propertyKey', data.response.self);
17267
+ assert.equal('propertyKey', data.response.key);
17268
+ assert.equal('propertyValue', data.response.value);
17269
+ } else {
17270
+ runCommonAsserts(data, error);
17271
+ }
17272
+ saveMockData('AppProperties', 'addonPropertiesResourceGetAddonPropertyGet', 'default', data);
17273
+ done();
17274
+ } catch (err) {
17275
+ log.error(`Test Failure: ${err}`);
17276
+ done(err);
17277
+ }
17278
+ });
17279
+ } catch (error) {
17280
+ log.error(`Adapter Exception: ${error}`);
17281
+ done(error);
17282
+ }
17283
+ }).timeout(attemptTimeout);
17284
+ });
17285
+
17286
+ const appPropertiesAddonPropertiesResourcePutAddonPropertyPutBodyParam = {};
17287
+ describe('#addonPropertiesResourcePutAddonPropertyPut - errors', () => {
17288
+ it('should work if integrated or standalone with mockdata', (done) => {
17289
+ try {
17290
+ a.addonPropertiesResourcePutAddonPropertyPut('fakedata', 'fakedata', appPropertiesAddonPropertiesResourcePutAddonPropertyPutBodyParam, (data, error) => {
17291
+ try {
17292
+ if (stub) {
17293
+ runCommonAsserts(data, error);
17294
+ assert.equal('success', data.response);
17295
+ } else {
17296
+ runCommonAsserts(data, error);
17297
+ }
17298
+ saveMockData('AppProperties', 'addonPropertiesResourcePutAddonPropertyPut', 'default', data);
17299
+ done();
17300
+ } catch (err) {
17301
+ log.error(`Test Failure: ${err}`);
17302
+ done(err);
17303
+ }
17304
+ });
17305
+ } catch (error) {
17306
+ log.error(`Adapter Exception: ${error}`);
17307
+ done(error);
17308
+ }
17309
+ }).timeout(attemptTimeout);
17310
+ });
17311
+
17312
+ describe('#addonPropertiesResourceDeleteAddonPropertyDelete - errors', () => {
17313
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
17314
+ try {
17315
+ a.addonPropertiesResourceDeleteAddonPropertyDelete('fakedata', 'fakedata', (data, error) => {
17316
+ try {
17317
+ if (stub) {
17318
+ const displayE = 'Error 400 received on request';
17319
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
17320
+ } else {
17321
+ runCommonAsserts(data, error);
17322
+ }
17323
+ saveMockData('AppProperties', 'addonPropertiesResourceDeleteAddonPropertyDelete', 'default', data);
17324
+ done();
17325
+ } catch (err) {
17326
+ log.error(`Test Failure: ${err}`);
17327
+ done(err);
17328
+ }
17329
+ });
17330
+ } catch (error) {
17331
+ log.error(`Adapter Exception: ${error}`);
17332
+ done(error);
17333
+ }
17334
+ }).timeout(attemptTimeout);
17335
+ });
17336
+
17337
+ const appPropertiesAddonPropertiesResourcePutAppPropertyPutBodyParam = {};
17338
+ describe('#addonPropertiesResourcePutAppPropertyPut - errors', () => {
17339
+ it('should work if integrated or standalone with mockdata', (done) => {
17340
+ try {
17341
+ a.addonPropertiesResourcePutAppPropertyPut('fakedata', appPropertiesAddonPropertiesResourcePutAppPropertyPutBodyParam, (data, error) => {
17342
+ try {
17343
+ if (stub) {
17344
+ runCommonAsserts(data, error);
17345
+ assert.equal('success', data.response);
17346
+ } else {
17347
+ runCommonAsserts(data, error);
17348
+ }
17349
+ saveMockData('AppProperties', 'addonPropertiesResourcePutAppPropertyPut', 'default', data);
17350
+ done();
17351
+ } catch (err) {
17352
+ log.error(`Test Failure: ${err}`);
17353
+ done(err);
17354
+ }
17355
+ });
17356
+ } catch (error) {
17357
+ log.error(`Adapter Exception: ${error}`);
17358
+ done(error);
17359
+ }
17360
+ }).timeout(attemptTimeout);
17361
+ });
17362
+
17363
+ describe('#addonPropertiesResourceDeleteAppPropertyDelete - errors', () => {
17364
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
17365
+ try {
17366
+ a.addonPropertiesResourceDeleteAppPropertyDelete('fakedata', (data, error) => {
17367
+ try {
17368
+ if (stub) {
17369
+ const displayE = 'Error 400 received on request';
17370
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
17371
+ } else {
17372
+ runCommonAsserts(data, error);
17373
+ }
17374
+ saveMockData('AppProperties', 'addonPropertiesResourceDeleteAppPropertyDelete', 'default', data);
17375
+ done();
17376
+ } catch (err) {
17377
+ log.error(`Test Failure: ${err}`);
17378
+ done(err);
17379
+ }
17380
+ });
17381
+ } catch (error) {
17382
+ log.error(`Adapter Exception: ${error}`);
17383
+ done(error);
17384
+ }
17385
+ }).timeout(attemptTimeout);
17386
+ });
17387
+
17388
+ describe('#dynamicModulesResourceGetModulesGet - errors', () => {
17389
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
17390
+ try {
17391
+ a.dynamicModulesResourceGetModulesGet((data, error) => {
17392
+ try {
17393
+ if (stub) {
17394
+ const displayE = 'Error 400 received on request';
17395
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
17396
+ } else {
17397
+ runCommonAsserts(data, error);
17398
+ }
17399
+ saveMockData('DynamicModules', 'dynamicModulesResourceGetModulesGet', 'default', data);
17400
+ done();
17401
+ } catch (err) {
17402
+ log.error(`Test Failure: ${err}`);
17403
+ done(err);
17404
+ }
17405
+ });
17406
+ } catch (error) {
17407
+ log.error(`Adapter Exception: ${error}`);
17408
+ done(error);
17409
+ }
17410
+ }).timeout(attemptTimeout);
17411
+ });
17412
+
17413
+ const dynamicModulesDynamicModulesResourceRegisterModulesPostBodyParam = {
17414
+ modules: [
17415
+ {
17416
+ description: {
17417
+ value: 'field with team'
17418
+ },
17419
+ type: 'single_select',
17420
+ extractions: [
17421
+ {
17422
+ path: 'category',
17423
+ type: 'text',
17424
+ name: 'categoryName'
17425
+ }
17426
+ ],
17427
+ name: {
17428
+ value: 'Team'
17429
+ },
17430
+ key: 'team-field'
17431
+ }
17432
+ ]
17433
+ };
17434
+ describe('#dynamicModulesResourceRegisterModulesPost - errors', () => {
17435
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
17436
+ try {
17437
+ a.dynamicModulesResourceRegisterModulesPost(dynamicModulesDynamicModulesResourceRegisterModulesPostBodyParam, (data, error) => {
17438
+ try {
17439
+ if (stub) {
17440
+ const displayE = 'Error 400 received on request';
17441
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
17442
+ } else {
17443
+ runCommonAsserts(data, error);
17444
+ }
17445
+ saveMockData('DynamicModules', 'dynamicModulesResourceRegisterModulesPost', 'default', data);
17446
+ done();
17447
+ } catch (err) {
17448
+ log.error(`Test Failure: ${err}`);
17449
+ done(err);
17450
+ }
17451
+ });
17452
+ } catch (error) {
17453
+ log.error(`Adapter Exception: ${error}`);
17454
+ done(error);
17455
+ }
17456
+ }).timeout(attemptTimeout);
17457
+ });
17458
+
17459
+ describe('#dynamicModulesResourceRemoveModulesDelete - errors', () => {
17460
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
17461
+ try {
17462
+ a.dynamicModulesResourceRemoveModulesDelete(null, (data, error) => {
17463
+ try {
17464
+ if (stub) {
17465
+ const displayE = 'Error 400 received on request';
17466
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
17467
+ } else {
17468
+ runCommonAsserts(data, error);
17469
+ }
17470
+ saveMockData('DynamicModules', 'dynamicModulesResourceRemoveModulesDelete', 'default', data);
17471
+ done();
17472
+ } catch (err) {
17473
+ log.error(`Test Failure: ${err}`);
17474
+ done(err);
17475
+ }
17476
+ });
17477
+ } catch (error) {
17478
+ log.error(`Adapter Exception: ${error}`);
17479
+ done(error);
17480
+ }
17481
+ }).timeout(attemptTimeout);
17482
+ });
17483
+
17484
+ const appMigrationAppIssueFieldValueUpdateResourceUpdateIssueFieldsPutBodyParam = {
17485
+ updateValueList: [
17486
+ {
17487
+ _type: 'StringIssueField',
17488
+ fieldID: 1,
17489
+ issueID: 9,
17490
+ number: 1,
17491
+ optionID: 'string',
17492
+ richText: 'string',
17493
+ string: 'string',
17494
+ text: 'string'
17495
+ }
17496
+ ]
17497
+ };
17498
+ describe('#appIssueFieldValueUpdateResourceUpdateIssueFieldsPut - errors', () => {
17499
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
17500
+ try {
17501
+ a.appIssueFieldValueUpdateResourceUpdateIssueFieldsPut(appMigrationAppIssueFieldValueUpdateResourceUpdateIssueFieldsPutBodyParam, (data, error) => {
17502
+ try {
17503
+ if (stub) {
17504
+ const displayE = 'Error 400 received on request';
17505
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
17506
+ } else {
17507
+ runCommonAsserts(data, error);
17508
+ }
17509
+ saveMockData('AppMigration', 'appIssueFieldValueUpdateResourceUpdateIssueFieldsPut', 'default', data);
17510
+ done();
17511
+ } catch (err) {
17512
+ log.error(`Test Failure: ${err}`);
17513
+ done(err);
17514
+ }
17515
+ });
17516
+ } catch (error) {
17517
+ log.error(`Adapter Exception: ${error}`);
17518
+ done(error);
17519
+ }
17520
+ }).timeout(attemptTimeout);
17521
+ });
17522
+
17523
+ const appMigrationMigrationResourceUpdateEntityPropertiesValuePutBodyParam = [
17524
+ {}
17525
+ ];
17526
+ describe('#migrationResourceUpdateEntityPropertiesValuePut - errors', () => {
17527
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
17528
+ try {
17529
+ a.migrationResourceUpdateEntityPropertiesValuePut('fakedata', appMigrationMigrationResourceUpdateEntityPropertiesValuePutBodyParam, (data, error) => {
17530
+ try {
17531
+ if (stub) {
17532
+ const displayE = 'Error 400 received on request';
17533
+ runErrorAsserts(data, error, 'AD.500', 'Test-jira-connectorRest-handleEndResponse', displayE);
17534
+ } else {
17535
+ runCommonAsserts(data, error);
17536
+ }
17537
+ saveMockData('AppMigration', 'migrationResourceUpdateEntityPropertiesValuePut', 'default', data);
17538
+ done();
17539
+ } catch (err) {
17540
+ log.error(`Test Failure: ${err}`);
17541
+ done(err);
17542
+ }
17543
+ });
17544
+ } catch (error) {
17545
+ log.error(`Adapter Exception: ${error}`);
17546
+ done(error);
17547
+ }
17548
+ }).timeout(attemptTimeout);
17549
+ });
17550
+
17551
+ const appMigrationMigrationResourceWorkflowRuleSearchPostBodyParam = {
17552
+ ruleIds: [
17553
+ '55d44f1d-c859-42e5-9c27-2c5ec3f340b1'
17554
+ ],
17555
+ workflowEntityId: 'a498d711-685d-428d-8c3e-bc03bb450ea7'
17556
+ };
17557
+ describe('#migrationResourceWorkflowRuleSearchPost - errors', () => {
17558
+ it('should work if integrated or standalone with mockdata', (done) => {
17559
+ try {
17560
+ a.migrationResourceWorkflowRuleSearchPost(appMigrationMigrationResourceWorkflowRuleSearchPostBodyParam, (data, error) => {
17561
+ try {
17562
+ if (stub) {
17563
+ runCommonAsserts(data, error);
17564
+ assert.equal('a498d711-685d-428d-8c3e-bc03bb450ea7', data.response.workflowEntityId);
17565
+ assert.equal(true, Array.isArray(data.response.invalidRules));
17566
+ assert.equal(true, Array.isArray(data.response.validRules));
17567
+ } else {
17568
+ runCommonAsserts(data, error);
17569
+ }
17570
+ saveMockData('AppMigration', 'migrationResourceWorkflowRuleSearchPost', 'default', data);
17571
+ done();
17572
+ } catch (err) {
17573
+ log.error(`Test Failure: ${err}`);
17574
+ done(err);
17575
+ }
17576
+ });
17577
+ } catch (error) {
17578
+ log.error(`Adapter Exception: ${error}`);
17579
+ done(error);
17580
+ }
17581
+ }).timeout(attemptTimeout);
17582
+ });
15680
17583
  });
15681
17584
  });