@itentialopensource/adapter-oracle_cloud 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUTH.md +39 -0
- package/BROKER.md +199 -0
- package/CALLS.md +169 -0
- package/CHANGELOG.md +9 -2
- package/CODE_OF_CONDUCT.md +12 -17
- package/CONTRIBUTING.md +88 -74
- package/ENHANCE.md +69 -0
- package/PROPERTIES.md +641 -0
- package/README.md +221 -571
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +335 -62
- package/adapterBase.js +1007 -253
- package/entities/.generic/action.json +105 -0
- package/entities/.generic/schema.json +6 -1
- package/error.json +6 -0
- package/package.json +5 -3
- package/pronghorn.json +642 -401
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +424 -3
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +10 -0
- package/report/updateReport1653049581192.json +120 -0
- package/sampleProperties.json +90 -1
- package/test/integration/adapterTestBasicGet.js +1 -1
- package/test/integration/adapterTestIntegration.js +47 -126
- package/test/unit/adapterBaseTestUnit.js +30 -25
- package/test/unit/adapterTestUnit.js +333 -318
- package/utils/adapterInfo.js +206 -0
- package/utils/artifactize.js +0 -0
- package/utils/entitiesToDB.js +12 -57
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/pre-commit.sh +3 -0
- package/utils/tbScript.js +35 -20
- package/utils/tbUtils.js +59 -35
- package/utils/testRunner.js +16 -16
package/sampleProperties.json
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"version": "",
|
|
9
9
|
"cache_location": "none",
|
|
10
10
|
"encode_pathvars": true,
|
|
11
|
-
"
|
|
11
|
+
"encode_queryvars": true,
|
|
12
|
+
"save_metric": false,
|
|
12
13
|
"stub": true,
|
|
13
14
|
"protocol": "https",
|
|
14
15
|
"authentication": {
|
|
@@ -97,6 +98,94 @@
|
|
|
97
98
|
"key_file": "",
|
|
98
99
|
"cert_file": ""
|
|
99
100
|
}
|
|
101
|
+
},
|
|
102
|
+
"devicebroker": {
|
|
103
|
+
"getDevice": [
|
|
104
|
+
{
|
|
105
|
+
"path": "/get/devices/{id}",
|
|
106
|
+
"method": "GET",
|
|
107
|
+
"query": {},
|
|
108
|
+
"body": {},
|
|
109
|
+
"headers": {},
|
|
110
|
+
"handleFailure": "ignore",
|
|
111
|
+
"requestFields": {
|
|
112
|
+
"id": "name"
|
|
113
|
+
},
|
|
114
|
+
"responseDatakey": "",
|
|
115
|
+
"responseFields": {
|
|
116
|
+
"name": "host",
|
|
117
|
+
"ostype": "os",
|
|
118
|
+
"ostypePrefix": "system-",
|
|
119
|
+
"ipaddress": "attributes.ipaddr",
|
|
120
|
+
"port": "443"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"getDevicesFiltered": [
|
|
125
|
+
{
|
|
126
|
+
"path": "/get/devices",
|
|
127
|
+
"method": "GET",
|
|
128
|
+
"query": {},
|
|
129
|
+
"body": {},
|
|
130
|
+
"headers": {},
|
|
131
|
+
"handleFailure": "ignore",
|
|
132
|
+
"requestFields": {},
|
|
133
|
+
"responseDatakey": "",
|
|
134
|
+
"responseFields": {
|
|
135
|
+
"name": "host",
|
|
136
|
+
"ostype": "os",
|
|
137
|
+
"ostypePrefix": "system-",
|
|
138
|
+
"ipaddress": "attributes.ipaddr",
|
|
139
|
+
"port": "443"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"isAlive": [
|
|
144
|
+
{
|
|
145
|
+
"path": "/get/devices/{id}/status",
|
|
146
|
+
"method": "GET",
|
|
147
|
+
"query": {},
|
|
148
|
+
"body": {},
|
|
149
|
+
"headers": {},
|
|
150
|
+
"handleFailure": "ignore",
|
|
151
|
+
"requestFields": {
|
|
152
|
+
"id": "name"
|
|
153
|
+
},
|
|
154
|
+
"responseDatakey": "",
|
|
155
|
+
"responseFields": {
|
|
156
|
+
"status": "status",
|
|
157
|
+
"statusValue": "online"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"getConfig": [
|
|
162
|
+
{
|
|
163
|
+
"path": "/get/devices/{id}/configPart1",
|
|
164
|
+
"method": "GET",
|
|
165
|
+
"query": {},
|
|
166
|
+
"body": {},
|
|
167
|
+
"headers": {},
|
|
168
|
+
"handleFailure": "ignore",
|
|
169
|
+
"requestFields": {
|
|
170
|
+
"id": "name"
|
|
171
|
+
},
|
|
172
|
+
"responseDatakey": "",
|
|
173
|
+
"responseFields": {}
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
"getCount": [
|
|
177
|
+
{
|
|
178
|
+
"path": "/get/devices",
|
|
179
|
+
"method": "GET",
|
|
180
|
+
"query": {},
|
|
181
|
+
"body": {},
|
|
182
|
+
"headers": {},
|
|
183
|
+
"handleFailure": "ignore",
|
|
184
|
+
"requestFields": {},
|
|
185
|
+
"responseDatakey": "",
|
|
186
|
+
"responseFields": {}
|
|
187
|
+
}
|
|
188
|
+
]
|
|
100
189
|
}
|
|
101
190
|
},
|
|
102
191
|
"groups": [],
|
|
@@ -34,7 +34,7 @@ describe('[integration] Adapter BasicGET Test', () => {
|
|
|
34
34
|
context('Testing GET calls without query parameters', () => {
|
|
35
35
|
before(async () => {
|
|
36
36
|
const iapDir = path.join(__dirname, '../../../../../');
|
|
37
|
-
if (!utils.
|
|
37
|
+
if (!utils.areWeUnderIAPinstallationDirectory()) {
|
|
38
38
|
const sampleProperties = require('../../sampleProperties.json');
|
|
39
39
|
const adapter = { properties: sampleProperties };
|
|
40
40
|
a = basicGet.getAdapterInstance(adapter);
|
|
@@ -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');
|
|
@@ -13,25 +15,39 @@ const winston = require('winston');
|
|
|
13
15
|
const { expect } = require('chai');
|
|
14
16
|
const { use } = require('chai');
|
|
15
17
|
const td = require('testdouble');
|
|
18
|
+
const util = require('util');
|
|
16
19
|
|
|
17
20
|
const anything = td.matchers.anything();
|
|
18
21
|
|
|
19
22
|
// stub and attemptTimeout are used throughout the code so set them here
|
|
20
23
|
let logLevel = 'none';
|
|
21
|
-
const stub = true;
|
|
22
24
|
const isRapidFail = false;
|
|
23
25
|
const isSaveMockData = false;
|
|
24
|
-
|
|
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;
|
|
25
35
|
|
|
26
36
|
// these variables can be changed to run in integrated mode so easier to set them here
|
|
27
37
|
// always check these in with bogus data!!!
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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;
|
|
35
51
|
|
|
36
52
|
// these are the adapter properties. You generally should not need to alter
|
|
37
53
|
// any of these after they are initially set up
|
|
@@ -41,104 +57,9 @@ global.pronghornProps = {
|
|
|
41
57
|
},
|
|
42
58
|
adapterProps: {
|
|
43
59
|
adapters: [{
|
|
44
|
-
id: 'Test-
|
|
60
|
+
id: 'Test-oracle_cloud',
|
|
45
61
|
type: 'OracleCloud',
|
|
46
|
-
properties:
|
|
47
|
-
host,
|
|
48
|
-
port,
|
|
49
|
-
base_path: '/',
|
|
50
|
-
version: '',
|
|
51
|
-
cache_location: 'none',
|
|
52
|
-
encode_pathvars: true,
|
|
53
|
-
save_metric: false,
|
|
54
|
-
stub,
|
|
55
|
-
protocol,
|
|
56
|
-
authentication: {
|
|
57
|
-
auth_method: 'request_token',
|
|
58
|
-
username,
|
|
59
|
-
password,
|
|
60
|
-
token: '',
|
|
61
|
-
invalid_token_error: 401,
|
|
62
|
-
token_timeout: 1800000,
|
|
63
|
-
token_cache: 'local',
|
|
64
|
-
auth_field: 'header.headers.X-AUTH-TOKEN',
|
|
65
|
-
auth_field_format: '{token}',
|
|
66
|
-
auth_logging: false,
|
|
67
|
-
client_id: '',
|
|
68
|
-
client_secret: '',
|
|
69
|
-
grant_type: ''
|
|
70
|
-
},
|
|
71
|
-
healthcheck: {
|
|
72
|
-
type: 'none',
|
|
73
|
-
frequency: 60000,
|
|
74
|
-
query_object: {}
|
|
75
|
-
},
|
|
76
|
-
throttle: {
|
|
77
|
-
throttle_enabled: false,
|
|
78
|
-
number_pronghorns: 1,
|
|
79
|
-
sync_async: 'sync',
|
|
80
|
-
max_in_queue: 1000,
|
|
81
|
-
concurrent_max: 1,
|
|
82
|
-
expire_timeout: 0,
|
|
83
|
-
avg_runtime: 200,
|
|
84
|
-
priorities: [
|
|
85
|
-
{
|
|
86
|
-
value: 0,
|
|
87
|
-
percent: 100
|
|
88
|
-
}
|
|
89
|
-
]
|
|
90
|
-
},
|
|
91
|
-
request: {
|
|
92
|
-
number_redirects: 0,
|
|
93
|
-
number_retries: 3,
|
|
94
|
-
limit_retry_error: [0],
|
|
95
|
-
failover_codes: [],
|
|
96
|
-
attempt_timeout: attemptTimeout,
|
|
97
|
-
global_request: {
|
|
98
|
-
payload: {},
|
|
99
|
-
uriOptions: {},
|
|
100
|
-
addlHeaders: {},
|
|
101
|
-
authData: {}
|
|
102
|
-
},
|
|
103
|
-
healthcheck_on_timeout: true,
|
|
104
|
-
return_raw: true,
|
|
105
|
-
archiving: false,
|
|
106
|
-
return_request: false
|
|
107
|
-
},
|
|
108
|
-
proxy: {
|
|
109
|
-
enabled: false,
|
|
110
|
-
host: '',
|
|
111
|
-
port: 1,
|
|
112
|
-
protocol: 'http',
|
|
113
|
-
username: '',
|
|
114
|
-
password: ''
|
|
115
|
-
},
|
|
116
|
-
ssl: {
|
|
117
|
-
ecdhCurve: '',
|
|
118
|
-
enabled: sslenable,
|
|
119
|
-
accept_invalid_cert: sslinvalid,
|
|
120
|
-
ca_file: '',
|
|
121
|
-
key_file: '',
|
|
122
|
-
cert_file: '',
|
|
123
|
-
secure_protocol: '',
|
|
124
|
-
ciphers: ''
|
|
125
|
-
},
|
|
126
|
-
mongo: {
|
|
127
|
-
host: '',
|
|
128
|
-
port: 0,
|
|
129
|
-
database: '',
|
|
130
|
-
username: '',
|
|
131
|
-
password: '',
|
|
132
|
-
replSet: '',
|
|
133
|
-
db_ssl: {
|
|
134
|
-
enabled: false,
|
|
135
|
-
accept_invalid_cert: false,
|
|
136
|
-
ca_file: '',
|
|
137
|
-
key_file: '',
|
|
138
|
-
cert_file: ''
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
62
|
+
properties: samProps
|
|
142
63
|
}]
|
|
143
64
|
}
|
|
144
65
|
};
|
|
@@ -1229,7 +1150,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
1229
1150
|
try {
|
|
1230
1151
|
if (stub) {
|
|
1231
1152
|
const displayE = 'Error 400 received on request';
|
|
1232
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
1153
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
1233
1154
|
} else {
|
|
1234
1155
|
runCommonAsserts(data, error);
|
|
1235
1156
|
}
|
|
@@ -1937,7 +1858,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
1937
1858
|
try {
|
|
1938
1859
|
if (stub) {
|
|
1939
1860
|
const displayE = 'Error 400 received on request';
|
|
1940
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
1861
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
1941
1862
|
} else {
|
|
1942
1863
|
runCommonAsserts(data, error);
|
|
1943
1864
|
}
|
|
@@ -1962,7 +1883,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
1962
1883
|
try {
|
|
1963
1884
|
if (stub) {
|
|
1964
1885
|
const displayE = 'Error 400 received on request';
|
|
1965
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
1886
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
1966
1887
|
} else {
|
|
1967
1888
|
runCommonAsserts(data, error);
|
|
1968
1889
|
}
|
|
@@ -1987,7 +1908,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
1987
1908
|
try {
|
|
1988
1909
|
if (stub) {
|
|
1989
1910
|
const displayE = 'Error 400 received on request';
|
|
1990
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
1911
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
1991
1912
|
} else {
|
|
1992
1913
|
runCommonAsserts(data, error);
|
|
1993
1914
|
}
|
|
@@ -2013,7 +1934,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
2013
1934
|
try {
|
|
2014
1935
|
if (stub) {
|
|
2015
1936
|
const displayE = 'Error 400 received on request';
|
|
2016
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
1937
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
2017
1938
|
} else {
|
|
2018
1939
|
runCommonAsserts(data, error);
|
|
2019
1940
|
}
|
|
@@ -2066,7 +1987,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
2066
1987
|
try {
|
|
2067
1988
|
if (stub) {
|
|
2068
1989
|
const displayE = 'Error 400 received on request';
|
|
2069
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
1990
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
2070
1991
|
} else {
|
|
2071
1992
|
runCommonAsserts(data, error);
|
|
2072
1993
|
}
|
|
@@ -2091,7 +2012,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
2091
2012
|
try {
|
|
2092
2013
|
if (stub) {
|
|
2093
2014
|
const displayE = 'Error 400 received on request';
|
|
2094
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
2015
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
2095
2016
|
} else {
|
|
2096
2017
|
runCommonAsserts(data, error);
|
|
2097
2018
|
}
|
|
@@ -2116,7 +2037,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
2116
2037
|
try {
|
|
2117
2038
|
if (stub) {
|
|
2118
2039
|
const displayE = 'Error 400 received on request';
|
|
2119
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
2040
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
2120
2041
|
} else {
|
|
2121
2042
|
runCommonAsserts(data, error);
|
|
2122
2043
|
}
|
|
@@ -3050,7 +2971,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
3050
2971
|
try {
|
|
3051
2972
|
if (stub) {
|
|
3052
2973
|
const displayE = 'Error 400 received on request';
|
|
3053
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
2974
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
3054
2975
|
} else {
|
|
3055
2976
|
runCommonAsserts(data, error);
|
|
3056
2977
|
}
|
|
@@ -3075,7 +2996,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
3075
2996
|
try {
|
|
3076
2997
|
if (stub) {
|
|
3077
2998
|
const displayE = 'Error 400 received on request';
|
|
3078
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
2999
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
3079
3000
|
} else {
|
|
3080
3001
|
runCommonAsserts(data, error);
|
|
3081
3002
|
}
|
|
@@ -3100,7 +3021,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
3100
3021
|
try {
|
|
3101
3022
|
if (stub) {
|
|
3102
3023
|
const displayE = 'Error 400 received on request';
|
|
3103
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
3024
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
3104
3025
|
} else {
|
|
3105
3026
|
runCommonAsserts(data, error);
|
|
3106
3027
|
}
|
|
@@ -3125,7 +3046,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
3125
3046
|
try {
|
|
3126
3047
|
if (stub) {
|
|
3127
3048
|
const displayE = 'Error 400 received on request';
|
|
3128
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
3049
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
3129
3050
|
} else {
|
|
3130
3051
|
runCommonAsserts(data, error);
|
|
3131
3052
|
}
|
|
@@ -3150,7 +3071,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
3150
3071
|
try {
|
|
3151
3072
|
if (stub) {
|
|
3152
3073
|
const displayE = 'Error 400 received on request';
|
|
3153
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
3074
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
3154
3075
|
} else {
|
|
3155
3076
|
runCommonAsserts(data, error);
|
|
3156
3077
|
}
|
|
@@ -3175,7 +3096,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
3175
3096
|
try {
|
|
3176
3097
|
if (stub) {
|
|
3177
3098
|
const displayE = 'Error 400 received on request';
|
|
3178
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
3099
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
3179
3100
|
} else {
|
|
3180
3101
|
runCommonAsserts(data, error);
|
|
3181
3102
|
}
|
|
@@ -3200,7 +3121,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
3200
3121
|
try {
|
|
3201
3122
|
if (stub) {
|
|
3202
3123
|
const displayE = 'Error 400 received on request';
|
|
3203
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
3124
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
3204
3125
|
} else {
|
|
3205
3126
|
runCommonAsserts(data, error);
|
|
3206
3127
|
}
|
|
@@ -3225,7 +3146,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
3225
3146
|
try {
|
|
3226
3147
|
if (stub) {
|
|
3227
3148
|
const displayE = 'Error 400 received on request';
|
|
3228
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
3149
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
3229
3150
|
} else {
|
|
3230
3151
|
runCommonAsserts(data, error);
|
|
3231
3152
|
}
|
|
@@ -3250,7 +3171,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
3250
3171
|
try {
|
|
3251
3172
|
if (stub) {
|
|
3252
3173
|
const displayE = 'Error 400 received on request';
|
|
3253
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
3174
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
3254
3175
|
} else {
|
|
3255
3176
|
runCommonAsserts(data, error);
|
|
3256
3177
|
}
|
|
@@ -3275,7 +3196,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
3275
3196
|
try {
|
|
3276
3197
|
if (stub) {
|
|
3277
3198
|
const displayE = 'Error 400 received on request';
|
|
3278
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
3199
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
3279
3200
|
} else {
|
|
3280
3201
|
runCommonAsserts(data, error);
|
|
3281
3202
|
}
|
|
@@ -3300,7 +3221,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
3300
3221
|
try {
|
|
3301
3222
|
if (stub) {
|
|
3302
3223
|
const displayE = 'Error 400 received on request';
|
|
3303
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
3224
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
3304
3225
|
} else {
|
|
3305
3226
|
runCommonAsserts(data, error);
|
|
3306
3227
|
}
|
|
@@ -3645,7 +3566,7 @@ describe('[integration] OracleCloud Adapter Test', () => {
|
|
|
3645
3566
|
try {
|
|
3646
3567
|
if (stub) {
|
|
3647
3568
|
const displayE = 'Error 400 received on request';
|
|
3648
|
-
runErrorAsserts(data, error, 'AD.500', 'Test-
|
|
3569
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-oracle_cloud-connectorRest-handleEndResponse', displayE);
|
|
3649
3570
|
} else {
|
|
3650
3571
|
runCommonAsserts(data, error);
|
|
3651
3572
|
}
|
|
@@ -317,8 +317,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
317
317
|
});
|
|
318
318
|
it('should return a list of functions', (done) => {
|
|
319
319
|
const returnedFunctions = ['addEntityCache', 'capabilityResults', 'checkActionFiles', 'checkProperties', 'connect', 'encryptProperty',
|
|
320
|
-
'entityInList', '
|
|
321
|
-
'
|
|
320
|
+
'entityInList', 'getAllCapabilities', 'getAllFunctions', 'getConfig', 'getDevice', 'getDevicesFiltered', 'hasDevices', 'hasEntities',
|
|
321
|
+
'healthCheck', 'iapFindAdapterPath', 'iapGetAdapterQueue', 'iapGetAdapterWorkflowFunctions', 'iapGetDeviceCount', 'iapMakeBrokerCall',
|
|
322
|
+
'iapMoveAdapterEntitiesToDB', 'iapRunAdapterBasicGet', 'iapRunAdapterConnectivity', 'iapRunAdapterHealthcheck', 'iapSuspendAdapter',
|
|
323
|
+
'iapTroubleshootAdapter', 'iapUnsuspendAdapter', 'iapUpdateAdapterConfiguration', 'isAlive', 'refreshProperties', 'addListener',
|
|
322
324
|
'emit', 'eventNames', 'getMaxListeners', 'listenerCount', 'listeners', 'off', 'on', 'once', 'prependListener',
|
|
323
325
|
'prependOnceListener', 'rawListeners', 'removeAllListeners', 'removeListener', 'setMaxListeners'];
|
|
324
326
|
try {
|
|
@@ -337,10 +339,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
337
339
|
}).timeout(attemptTimeout);
|
|
338
340
|
});
|
|
339
341
|
|
|
340
|
-
describe('#
|
|
341
|
-
it('should have a
|
|
342
|
+
describe('#iapGetAdapterWorkflowFunctions', () => {
|
|
343
|
+
it('should have a iapGetAdapterWorkflowFunctions function', (done) => {
|
|
342
344
|
try {
|
|
343
|
-
assert.equal(true, typeof a.
|
|
345
|
+
assert.equal(true, typeof a.iapGetAdapterWorkflowFunctions === 'function');
|
|
344
346
|
done();
|
|
345
347
|
} catch (error) {
|
|
346
348
|
log.error(`Test Failure: ${error}`);
|
|
@@ -349,7 +351,7 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
349
351
|
});
|
|
350
352
|
it('should retrieve workflow functions', (done) => {
|
|
351
353
|
try {
|
|
352
|
-
const expectedFunctions = a.
|
|
354
|
+
const expectedFunctions = a.iapGetAdapterWorkflowFunctions([]);
|
|
353
355
|
try {
|
|
354
356
|
assert.equal(0, expectedFunctions.length);
|
|
355
357
|
done();
|
|
@@ -426,10 +428,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
426
428
|
}).timeout(attemptTimeout);
|
|
427
429
|
});
|
|
428
430
|
|
|
429
|
-
describe('#
|
|
430
|
-
it('should have a
|
|
431
|
+
describe('#iapGetAdapterQueue', () => {
|
|
432
|
+
it('should have a iapGetAdapterQueue function', (done) => {
|
|
431
433
|
try {
|
|
432
|
-
assert.equal(true, typeof a.
|
|
434
|
+
assert.equal(true, typeof a.iapGetAdapterQueue === 'function');
|
|
433
435
|
done();
|
|
434
436
|
} catch (error) {
|
|
435
437
|
log.error(`Test Failure: ${error}`);
|
|
@@ -438,7 +440,7 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
438
440
|
});
|
|
439
441
|
it('should get information for all of the requests currently in the queue', (done) => {
|
|
440
442
|
try {
|
|
441
|
-
const expectedFunctions = a.
|
|
443
|
+
const expectedFunctions = a.iapGetAdapterQueue();
|
|
442
444
|
try {
|
|
443
445
|
assert.equal(0, expectedFunctions.length);
|
|
444
446
|
done();
|
|
@@ -817,12 +819,17 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
817
819
|
try {
|
|
818
820
|
assert.notEqual(0, expectedCapabilities.length);
|
|
819
821
|
assert.equal('.generic', expectedCapabilities[0].entity);
|
|
820
|
-
assert.equal(
|
|
822
|
+
assert.equal(10, expectedCapabilities[0].actions.length);
|
|
821
823
|
assert.equal('getGenerics', expectedCapabilities[0].actions[0]);
|
|
822
824
|
assert.equal('createGeneric', expectedCapabilities[0].actions[1]);
|
|
823
825
|
assert.equal('updateGeneric', expectedCapabilities[0].actions[2]);
|
|
824
826
|
assert.equal('patchGeneric', expectedCapabilities[0].actions[3]);
|
|
825
827
|
assert.equal('deleteGeneric', expectedCapabilities[0].actions[4]);
|
|
828
|
+
assert.equal('getGenericsNoBase', expectedCapabilities[0].actions[5]);
|
|
829
|
+
assert.equal('createGenericNoBase', expectedCapabilities[0].actions[6]);
|
|
830
|
+
assert.equal('updateGenericNoBase', expectedCapabilities[0].actions[7]);
|
|
831
|
+
assert.equal('patchGenericNoBase', expectedCapabilities[0].actions[8]);
|
|
832
|
+
assert.equal('deleteGenericNoBase', expectedCapabilities[0].actions[9]);
|
|
826
833
|
assert.equal('.system', expectedCapabilities[1].entity);
|
|
827
834
|
assert.equal(2, expectedCapabilities[1].actions.length);
|
|
828
835
|
assert.equal('getToken', expectedCapabilities[1].actions[0]);
|
|
@@ -843,12 +850,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
843
850
|
}).timeout(attemptTimeout);
|
|
844
851
|
});
|
|
845
852
|
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
describe('#updateAdapterConfiguration', () => {
|
|
849
|
-
it('should have a updateAdapterConfiguration function', (done) => {
|
|
853
|
+
describe('#iapUpdateAdapterConfiguration', () => {
|
|
854
|
+
it('should have a iapUpdateAdapterConfiguration function', (done) => {
|
|
850
855
|
try {
|
|
851
|
-
assert.equal(true, typeof a.
|
|
856
|
+
assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
|
|
852
857
|
done();
|
|
853
858
|
} catch (error) {
|
|
854
859
|
log.error(`Test Failure: ${error}`);
|
|
@@ -857,7 +862,7 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
857
862
|
});
|
|
858
863
|
it('should return no updated if no changes are provided', (done) => {
|
|
859
864
|
try {
|
|
860
|
-
a.
|
|
865
|
+
a.iapUpdateAdapterConfiguration(null, null, null, null, null, (data, error) => {
|
|
861
866
|
try {
|
|
862
867
|
assert.equal('No configuration updates to make', data.response);
|
|
863
868
|
done();
|
|
@@ -873,10 +878,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
873
878
|
}).timeout(attemptTimeout);
|
|
874
879
|
it('should throw an error if missing configuration file', (done) => {
|
|
875
880
|
try {
|
|
876
|
-
a.
|
|
881
|
+
a.iapUpdateAdapterConfiguration(null, { name: 'fakeChange' }, null, null, null, (data, error) => {
|
|
877
882
|
try {
|
|
878
883
|
const displayE = 'configFile is required';
|
|
879
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-
|
|
884
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
|
880
885
|
done();
|
|
881
886
|
} catch (err) {
|
|
882
887
|
log.error(`Test Failure: ${err}`);
|
|
@@ -890,10 +895,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
890
895
|
}).timeout(attemptTimeout);
|
|
891
896
|
it('if not package.json, entity is required', (done) => {
|
|
892
897
|
try {
|
|
893
|
-
a.
|
|
898
|
+
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, null, null, null, (data, error) => {
|
|
894
899
|
try {
|
|
895
900
|
const displayE = 'Unsupported Configuration Change or Missing Entity';
|
|
896
|
-
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-
|
|
901
|
+
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
|
897
902
|
done();
|
|
898
903
|
} catch (err) {
|
|
899
904
|
log.error(`Test Failure: ${err}`);
|
|
@@ -907,10 +912,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
907
912
|
}).timeout(attemptTimeout);
|
|
908
913
|
it('if not package.json, type is required', (done) => {
|
|
909
914
|
try {
|
|
910
|
-
a.
|
|
915
|
+
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'entity', null, null, (data, error) => {
|
|
911
916
|
try {
|
|
912
917
|
const displayE = 'type is required';
|
|
913
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-
|
|
918
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
|
914
919
|
done();
|
|
915
920
|
} catch (err) {
|
|
916
921
|
log.error(`Test Failure: ${err}`);
|
|
@@ -924,10 +929,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
924
929
|
}).timeout(attemptTimeout);
|
|
925
930
|
it('if not package.json, entity must be valid', (done) => {
|
|
926
931
|
try {
|
|
927
|
-
a.
|
|
932
|
+
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'fakeEntity', 'fakeType', null, (data, error) => {
|
|
928
933
|
try {
|
|
929
934
|
const displayE = 'Incomplete Configuration Change: Invalid Entity - fakeEntity';
|
|
930
|
-
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-
|
|
935
|
+
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
|
931
936
|
done();
|
|
932
937
|
} catch (err) {
|
|
933
938
|
log.error(`Test Failure: ${err}`);
|