@itentialopensource/adapter-phpipam 2.0.2 → 2.1.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 (49) hide show
  1. package/.eslintignore +1 -0
  2. package/AUTH.md +39 -0
  3. package/BROKER.md +199 -0
  4. package/CALLS.md +169 -0
  5. package/CHANGELOG.md +55 -21
  6. package/CODE_OF_CONDUCT.md +12 -17
  7. package/CONTRIBUTING.md +88 -74
  8. package/ENHANCE.md +69 -0
  9. package/PROPERTIES.md +641 -0
  10. package/README.md +228 -420
  11. package/SUMMARY.md +9 -0
  12. package/SYSTEMINFO.md +11 -0
  13. package/TROUBLESHOOT.md +47 -0
  14. package/adapter.js +1193 -47
  15. package/adapterBase.js +1270 -238
  16. package/entities/.generic/action.json +214 -0
  17. package/entities/.generic/schema.json +28 -0
  18. package/entities/.system/schemaTokenReq.json +0 -4
  19. package/error.json +12 -0
  20. package/package.json +44 -20
  21. package/pronghorn.json +656 -78
  22. package/propertiesDecorators.json +14 -0
  23. package/propertiesSchema.json +472 -4
  24. package/refs?service=git-upload-pack +0 -0
  25. package/report/adapterInfo.json +10 -0
  26. package/report/updateReport1615500653949.json +95 -0
  27. package/report/updateReport1653302326761.json +120 -0
  28. package/sampleProperties.json +102 -5
  29. package/test/integration/adapterTestBasicGet.js +85 -0
  30. package/test/integration/adapterTestConnectivity.js +93 -0
  31. package/test/integration/adapterTestIntegration.js +36 -105
  32. package/test/unit/adapterBaseTestUnit.js +949 -0
  33. package/test/unit/adapterTestUnit.js +667 -117
  34. package/utils/adapterInfo.js +206 -0
  35. package/utils/addAuth.js +94 -0
  36. package/utils/basicGet.js +50 -0
  37. package/utils/checkMigrate.js +63 -0
  38. package/utils/entitiesToDB.js +179 -0
  39. package/utils/findPath.js +74 -0
  40. package/utils/modify.js +154 -0
  41. package/utils/packModificationScript.js +1 -1
  42. package/utils/patches2bundledDeps.js +90 -0
  43. package/utils/pre-commit.sh +3 -0
  44. package/utils/removeHooks.js +20 -0
  45. package/utils/tbScript.js +184 -0
  46. package/utils/tbUtils.js +469 -0
  47. package/utils/testRunner.js +16 -16
  48. package/utils/troubleshootingAdapter.js +190 -0
  49. package/img/adapter.png +0 -0
@@ -0,0 +1,120 @@
1
+ {
2
+ "errors": [],
3
+ "statistics": [
4
+ {
5
+ "owner": "errorJson",
6
+ "description": "New adapter errors available for use",
7
+ "value": 2
8
+ },
9
+ {
10
+ "owner": "errorJson",
11
+ "description": "Adapter errors no longer available for use",
12
+ "value": 0
13
+ },
14
+ {
15
+ "owner": "errorJson",
16
+ "description": "Adapter errors that have been updated (e.g. recommendation changes)",
17
+ "value": 29
18
+ },
19
+ {
20
+ "owner": "packageJson",
21
+ "description": "Number of production dependencies",
22
+ "value": 14
23
+ },
24
+ {
25
+ "owner": "packageJson",
26
+ "description": "Number of development dependencies",
27
+ "value": 7
28
+ },
29
+ {
30
+ "owner": "packageJson",
31
+ "description": "Number of npm scripts",
32
+ "value": 22
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "^4.45.6"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 70
43
+ },
44
+ {
45
+ "owner": "markdown",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 338
48
+ },
49
+ {
50
+ "owner": "markdown",
51
+ "description": "Number of lines in the SUMMARY.md",
52
+ "value": 9
53
+ },
54
+ {
55
+ "owner": "markdown",
56
+ "description": "Number of lines in the PROPERTIES.md",
57
+ "value": 642
58
+ },
59
+ {
60
+ "owner": "markdown",
61
+ "description": "Number of lines in the TROUBLESHOOT.md",
62
+ "value": 48
63
+ },
64
+ {
65
+ "owner": "markdown",
66
+ "description": "Number of lines in the ENHANCE.md",
67
+ "value": 70
68
+ },
69
+ {
70
+ "owner": "markdown",
71
+ "description": "Number of lines in the BROKER.md",
72
+ "value": 70
73
+ },
74
+ {
75
+ "owner": "unitTestJS",
76
+ "description": "Number of lines of code in unit tests",
77
+ "value": 4040
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 245
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 2845
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 103
93
+ },
94
+ {
95
+ "owner": "staticFile",
96
+ "description": "Number of lines of code in adapterBase.js",
97
+ "value": 1783
98
+ },
99
+ {
100
+ "owner": "staticFile",
101
+ "description": "Number of static files added",
102
+ "value": 36
103
+ },
104
+ {
105
+ "owner": "Overall",
106
+ "description": "Total lines of Code",
107
+ "value": 8668
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 348
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }
@@ -8,7 +8,8 @@
8
8
  "version": "100",
9
9
  "cache_location": "none",
10
10
  "encode_pathvars": true,
11
- "save_metric": true,
11
+ "encode_queryvars": true,
12
+ "save_metric": false,
12
13
  "stub": false,
13
14
  "protocol": "https",
14
15
  "authentication": {
@@ -20,11 +21,16 @@
20
21
  "token_cache": "local",
21
22
  "invalid_token_error": 401,
22
23
  "auth_field": "header.headers.X-AUTH-TOKEN",
23
- "auth_field_format": "{token}"
24
+ "auth_field_format": "{token}",
25
+ "auth_logging": false,
26
+ "client_id": "",
27
+ "client_secret": "",
28
+ "grant_type": ""
24
29
  },
25
30
  "healthcheck": {
26
31
  "type": "startup",
27
- "frequency": 60000
32
+ "frequency": 60000,
33
+ "query_object": {}
28
34
  },
29
35
  "throttle": {
30
36
  "throttle_enabled": false,
@@ -57,13 +63,16 @@
57
63
  },
58
64
  "healthcheck_on_timeout": true,
59
65
  "return_raw": false,
60
- "archiving": false
66
+ "archiving": false,
67
+ "return_request": false
61
68
  },
62
69
  "proxy": {
63
70
  "enabled": false,
64
71
  "host": "",
65
72
  "port": 1,
66
- "protocol": "http"
73
+ "protocol": "http",
74
+ "username": "",
75
+ "password": ""
67
76
  },
68
77
  "ssl": {
69
78
  "ecdhCurve": "",
@@ -89,6 +98,94 @@
89
98
  "key_file": "",
90
99
  "cert_file": ""
91
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
+ ]
92
189
  }
93
190
  },
94
191
  "groups": [],
@@ -0,0 +1,85 @@
1
+ /* @copyright Itential, LLC 2020 */
2
+
3
+ /* global describe context before after */
4
+ /* eslint global-require: warn */
5
+ /* eslint no-unused-vars: warn */
6
+ /* eslint import/no-extraneous-dependencies: warn */
7
+ /* eslint import/no-dynamic-require: warn */
8
+ /* eslint import/no-unresolved: warn */
9
+
10
+ const mocha = require('mocha');
11
+ const path = require('path');
12
+ const assert = require('assert');
13
+ const itParam = require('mocha-param');
14
+
15
+ const utils = require('../../utils/tbUtils');
16
+ const basicGet = require('../../utils/basicGet');
17
+ const { name } = require('../../package.json');
18
+ const { methods } = require('../../pronghorn.json');
19
+
20
+ const getPronghornProps = (iapDir) => {
21
+ const { Discovery } = require('@itential/itential-utils');
22
+ console.log('Retrieving properties.json file...');
23
+ const rawProps = require(path.join(iapDir, 'properties.json'));
24
+ console.log('Decrypting properties...');
25
+ const discovery = new Discovery();
26
+ const pronghornProps = utils.decryptProperties(rawProps, path.join(__dirname, '..'), discovery);
27
+ console.log('Found properties.\n');
28
+ return pronghornProps;
29
+ };
30
+
31
+ let a;
32
+
33
+ describe('[integration] Adapter BasicGET Test', () => {
34
+ context('Testing GET calls without query parameters', () => {
35
+ before(async () => {
36
+ const iapDir = path.join(__dirname, '../../../../../');
37
+ if (!utils.areWeUnderIAPinstallationDirectory()) {
38
+ const sampleProperties = require('../../sampleProperties.json');
39
+ const adapter = { properties: sampleProperties };
40
+ a = basicGet.getAdapterInstance(adapter);
41
+ } else {
42
+ const pronghornProps = getPronghornProps(iapDir);
43
+ console.log('Connecting to Database...');
44
+ const database = await basicGet.connect(pronghornProps);
45
+ console.log('Connection established.');
46
+ const adapter = await database.collection(utils.SERVICE_CONFIGS_COLLECTION).findOne(
47
+ { model: name }
48
+ );
49
+ a = basicGet.getAdapterInstance(adapter);
50
+ }
51
+ });
52
+
53
+ after((done) => {
54
+ done();
55
+ });
56
+
57
+ const basicGets = methods.filter((method) => (method.route.verb === 'GET' && method.input.length === 0));
58
+ if (basicGets.length === 0) {
59
+ console.log('No non-parameter GET calls found.');
60
+ process.exit(0);
61
+ }
62
+ const functionNames = basicGets.map((g) => g.name);
63
+ const request = function request(f, ad) {
64
+ return new Promise((resolve, reject) => {
65
+ const getRespCode = (resp) => {
66
+ if (resp) {
67
+ if (resp.metrics.code !== 200) {
68
+ console.log('\x1b[31m', `Testing ${f} \nResponseCode: ${resp.metrics.code}`);
69
+ }
70
+ resolve(resp.metrics.code);
71
+ } else {
72
+ console.log('\x1b[31m', `call ${f} results in failure`);
73
+ reject(new Error(`${f} failed`));
74
+ }
75
+ };
76
+ ad[f](getRespCode, console.log);
77
+ });
78
+ };
79
+
80
+ itParam('GET call should return 200', functionNames, (fname) => {
81
+ console.log(`\t ${fname}`);
82
+ return request(fname, a).then((result) => assert.equal(result, 200));
83
+ });
84
+ });
85
+ });
@@ -0,0 +1,93 @@
1
+ /* @copyright Itential, LLC 2020 */
2
+
3
+ /* global describe it context before after */
4
+ /* eslint no-unused-vars: warn */
5
+
6
+ const mocha = require('mocha');
7
+ const assert = require('assert');
8
+ const diagnostics = require('network-diagnostics');
9
+
10
+ let host;
11
+ process.argv.forEach((val) => {
12
+ if (val.indexOf('--HOST') === 0) {
13
+ [, host] = val.split('=');
14
+ }
15
+ });
16
+
17
+ describe('[integration] Adapter Test', () => {
18
+ context(`Testing network connection on ${host}`, () => {
19
+ before(() => {
20
+ diagnostics.setTestURL(host);
21
+ });
22
+
23
+ after((done) => {
24
+ done();
25
+ });
26
+
27
+ it('DNS resolve', (done) => {
28
+ diagnostics.haveDNS((result) => {
29
+ try {
30
+ assert.equal(result, true);
31
+ done();
32
+ } catch (error) {
33
+ done(error);
34
+ }
35
+ });
36
+ });
37
+
38
+ it('Responds to ping', (done) => {
39
+ diagnostics.havePing((result) => {
40
+ try {
41
+ assert.equal(result, true);
42
+ done();
43
+ } catch (error) {
44
+ done(error);
45
+ }
46
+ });
47
+ });
48
+
49
+ it('Support HTTP on port 80', (done) => {
50
+ diagnostics.haveHTTP((result) => {
51
+ try {
52
+ assert.equal(result, true);
53
+ done();
54
+ } catch (error) {
55
+ done(error);
56
+ }
57
+ });
58
+ });
59
+
60
+ it('Support HTTPS on port 443', (done) => {
61
+ diagnostics.haveHTTPS((result) => {
62
+ try {
63
+ assert.equal(result, true);
64
+ done();
65
+ } catch (error) {
66
+ done(error);
67
+ }
68
+ });
69
+ });
70
+
71
+ it('Support IPv4', (done) => {
72
+ diagnostics.haveIPv4Async((result) => {
73
+ try {
74
+ assert.equal(result, true);
75
+ done();
76
+ } catch (error) {
77
+ done(error);
78
+ }
79
+ });
80
+ });
81
+
82
+ it('Support IPv6', (done) => {
83
+ diagnostics.haveIPv6Async((result) => {
84
+ try {
85
+ assert.equal(result, true);
86
+ done();
87
+ } catch (error) {
88
+ done(error);
89
+ }
90
+ });
91
+ });
92
+ });
93
+ });
@@ -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
- const attemptTimeout = 5000;
26
+
27
+ // read in the properties from the sampleProperties files
28
+ let adaptdir = __dirname;
29
+ if (adaptdir.endsWith('/test/integration')) {
30
+ adaptdir = adaptdir.substring(0, adaptdir.length - 17);
31
+ } else if (adaptdir.endsWith('/test/unit')) {
32
+ adaptdir = adaptdir.substring(0, adaptdir.length - 10);
33
+ }
34
+ const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
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
- const host = 'replace.hostorip.here';
29
- const username = 'username';
30
- const password = 'password';
31
- const protocol = 'http';
32
- const port = 80;
33
- const sslenable = false;
34
- const sslinvalid = false;
38
+ samProps.stub = true;
39
+ samProps.host = 'replace.hostorip.here';
40
+ samProps.authentication.username = 'username';
41
+ samProps.authentication.password = 'password';
42
+ samProps.protocol = 'http';
43
+ samProps.port = 80;
44
+ samProps.ssl.enabled = false;
45
+ samProps.ssl.accept_invalid_cert = false;
46
+ if (samProps.request.attempt_timeout < 30000) {
47
+ samProps.request.attempt_timeout = 30000;
48
+ }
49
+ const attemptTimeout = samProps.request.attempt_timeout;
50
+ const { stub } = samProps;
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
@@ -43,94 +59,7 @@ global.pronghornProps = {
43
59
  adapters: [{
44
60
  id: 'Test-phpipam',
45
61
  type: 'Phpipam',
46
- properties: {
47
- host,
48
- port,
49
- base_path: '/api',
50
- version: '100',
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
- },
67
- healthcheck: {
68
- type: 'startup',
69
- frequency: 60000
70
- },
71
- throttle: {
72
- throttle_enabled: false,
73
- number_pronghorns: 1,
74
- sync_async: 'sync',
75
- max_in_queue: 1000,
76
- concurrent_max: 1,
77
- expire_timeout: 0,
78
- avg_runtime: 200,
79
- priorities: [
80
- {
81
- value: 0,
82
- percent: 100
83
- }
84
- ]
85
- },
86
- request: {
87
- number_redirects: 0,
88
- number_retries: 3,
89
- limit_retry_error: [0],
90
- failover_codes: [],
91
- attempt_timeout: attemptTimeout,
92
- global_request: {
93
- payload: {},
94
- uriOptions: {},
95
- addlHeaders: {},
96
- authData: {}
97
- },
98
- healthcheck_on_timeout: true,
99
- return_raw: true,
100
- archiving: false
101
- },
102
- proxy: {
103
- enabled: false,
104
- host: '',
105
- port: 1,
106
- protocol: 'http'
107
- },
108
- ssl: {
109
- ecdhCurve: '',
110
- enabled: sslenable,
111
- accept_invalid_cert: sslinvalid,
112
- ca_file: '',
113
- key_file: '',
114
- cert_file: '',
115
- secure_protocol: '',
116
- ciphers: ''
117
- },
118
- mongo: {
119
- host: '',
120
- port: 0,
121
- database: '',
122
- username: '',
123
- password: '',
124
- replSet: '',
125
- db_ssl: {
126
- enabled: false,
127
- accept_invalid_cert: false,
128
- ca_file: '',
129
- key_file: '',
130
- cert_file: ''
131
- }
132
- }
133
- }
62
+ properties: samProps
134
63
  }]
135
64
  }
136
65
  };
@@ -305,7 +234,7 @@ function saveMockData(entityName, actionName, descriptor, responseData) {
305
234
  }
306
235
 
307
236
  // require the adapter that we are going to be using
308
- const Phpipam = require('../../adapter.js');
237
+ const Phpipam = require('../../adapter');
309
238
 
310
239
  // begin the testing - these should be pretty well defined between the describe and the it!
311
240
  describe('[integration] Phpipam Adapter Test', () => {
@@ -336,6 +265,8 @@ describe('[integration] Phpipam Adapter Test', () => {
336
265
  try {
337
266
  assert.notEqual(null, a);
338
267
  assert.notEqual(undefined, a);
268
+ const checkId = global.pronghornProps.adapterProps.adapters[0].id;
269
+ assert.equal(checkId, a.id);
339
270
  assert.notEqual(null, a.allProps);
340
271
  const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
341
272
  assert.equal(check, a.healthcheckType);
@@ -1287,7 +1218,7 @@ describe('[integration] Phpipam Adapter Test', () => {
1287
1218
  describe('#updateAddress - errors', () => {
1288
1219
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1289
1220
  try {
1290
- a.updateAddress(addressesUpdateAddressBodyParam, (data, error) => {
1221
+ a.updateAddress(addressesId, addressesUpdateAddressBodyParam, (data, error) => {
1291
1222
  try {
1292
1223
  if (stub) {
1293
1224
  const displayE = 'Error 400 received on request';
@@ -1973,10 +1904,10 @@ describe('[integration] Phpipam Adapter Test', () => {
1973
1904
  }).timeout(attemptTimeout);
1974
1905
  });
1975
1906
 
1976
- describe('#getDevices - errors', () => {
1907
+ describe('#getPhpDevices - errors', () => {
1977
1908
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1978
1909
  try {
1979
- a.getDevices(null, (data, error) => {
1910
+ a.getPhpDevices(null, (data, error) => {
1980
1911
  try {
1981
1912
  if (stub) {
1982
1913
  const displayE = 'Error 400 received on request';
@@ -1984,7 +1915,7 @@ describe('[integration] Phpipam Adapter Test', () => {
1984
1915
  } else {
1985
1916
  runCommonAsserts(data, error);
1986
1917
  }
1987
- saveMockData('Devices', 'getDevices', 'default', data);
1918
+ saveMockData('Devices', 'getPhpDevices', 'default', data);
1988
1919
  done();
1989
1920
  } catch (err) {
1990
1921
  log.error(`Test Failure: ${err}`);
@@ -2025,10 +1956,10 @@ describe('[integration] Phpipam Adapter Test', () => {
2025
1956
  });
2026
1957
 
2027
1958
  const devicesId = 'fakedata';
2028
- describe('#getDevice - errors', () => {
1959
+ describe('#getPhpDevice - errors', () => {
2029
1960
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2030
1961
  try {
2031
- a.getDevice(devicesId, null, (data, error) => {
1962
+ a.getPhpDevice(devicesId, null, (data, error) => {
2032
1963
  try {
2033
1964
  if (stub) {
2034
1965
  const displayE = 'Error 400 received on request';
@@ -2036,7 +1967,7 @@ describe('[integration] Phpipam Adapter Test', () => {
2036
1967
  } else {
2037
1968
  runCommonAsserts(data, error);
2038
1969
  }
2039
- saveMockData('Devices', 'getDevice', 'default', data);
1970
+ saveMockData('Devices', 'getPhpDevice', 'default', data);
2040
1971
  done();
2041
1972
  } catch (err) {
2042
1973
  log.error(`Test Failure: ${err}`);