@itentialopensource/adapter-amazon_route53
Version:
This adapter integrates with system described as: Amazon Route53.
3,555 lines • 141 kB
JavaScript
/* @copyright Itential, LLC 2019 (pre-modifications) */
// Set globals
/* global describe it log pronghornProps */
/* eslint global-require: warn */
/* eslint no-unused-vars: warn */
/* eslint import/no-dynamic-require:warn */
// include required items for testing & logging
const assert = require('assert');
const path = require('path');
const util = require('util');
const execute = require('child_process').execSync;
const fs = require('fs-extra');
const mocha = require('mocha');
const winston = require('winston');
const { expect } = require('chai');
const { use } = require('chai');
const td = require('testdouble');
const Ajv = require('ajv');
const log = require('../../utils/logger');
const ajv = new Ajv({ strictSchema: false, allErrors: true, allowUnionTypes: true });
const anything = td.matchers.anything();
const isRapidFail = false;
// read in the properties from the sampleProperties files
let adaptdir = __dirname;
if (adaptdir.endsWith('/test/integration')) {
adaptdir = adaptdir.substring(0, adaptdir.length - 17);
} else if (adaptdir.endsWith('/test/unit')) {
adaptdir = adaptdir.substring(0, adaptdir.length - 10);
}
const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
// these variables can be changed to run in integrated mode so easier to set them here
// always check these in with bogus data!!!
samProps.stub = true;
// uncomment if connecting
// samProps.host = 'replace.hostorip.here';
// samProps.authentication.username = 'username';
// samProps.authentication.password = 'password';
// samProps.authentication.token = 'password';
// samProps.protocol = 'http';
// samProps.port = 80;
// samProps.ssl.enabled = false;
// samProps.ssl.accept_invalid_cert = false;
samProps.request.attempt_timeout = 1200000;
const attemptTimeout = samProps.request.attempt_timeout;
const { stub } = samProps;
// these are the adapter properties. You generally should not need to alter
// any of these after they are initially set up
global.pronghornProps = {
pathProps: {
encrypted: false
},
adapterProps: {
adapters: [{
id: 'Test-amazon_route53',
type: 'AmazonRoute53',
properties: samProps
}]
}
};
global.$HOME = `${__dirname}/../..`;
/**
* Runs the error asserts for the test
*/
function runErrorAsserts(data, error, code, origin, displayStr) {
assert.equal(null, data);
assert.notEqual(undefined, error);
assert.notEqual(null, error);
assert.notEqual(undefined, error.IAPerror);
assert.notEqual(null, error.IAPerror);
assert.notEqual(undefined, error.IAPerror.displayString);
assert.notEqual(null, error.IAPerror.displayString);
assert.equal(code, error.icode);
assert.equal(origin, error.IAPerror.origin);
assert.equal(displayStr, error.IAPerror.displayString);
}
// require the adapter that we are going to be using
const AmazonRoute53 = require('../../adapter');
// delete the .DS_Store directory in entities -- otherwise this will cause errors
const dirPath = path.join(__dirname, '../../entities/.DS_Store');
if (fs.existsSync(dirPath)) {
try {
fs.removeSync(dirPath);
console.log('.DS_Store deleted');
} catch (e) {
console.log('Error when deleting .DS_Store:', e);
}
}
// begin the testing - these should be pretty well defined between the describe and the it!
describe('[unit] Amazon_route53 Adapter Test', () => {
describe('AmazonRoute53 Class Tests', () => {
const a = new AmazonRoute53(
pronghornProps.adapterProps.adapters[0].id,
pronghornProps.adapterProps.adapters[0].properties
);
if (isRapidFail) {
const state = {};
state.passed = true;
mocha.afterEach(function x() {
state.passed = state.passed
&& (this.currentTest.state === 'passed');
});
mocha.beforeEach(function x() {
if (!state.passed) {
return this.currentTest.skip();
}
return true;
});
}
describe('#class instance created', () => {
it('should be a class with properties', (done) => {
try {
assert.notEqual(null, a);
assert.notEqual(undefined, a);
const checkId = global.pronghornProps.adapterProps.adapters[0].id;
assert.equal(checkId, a.id);
assert.notEqual(null, a.allProps);
const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
assert.equal(check, a.healthcheckType);
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('adapterBase.js', () => {
it('should have an adapterBase.js', (done) => {
try {
fs.exists('adapterBase.js', (val) => {
assert.equal(true, val);
done();
});
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
let wffunctions = [];
describe('#iapGetAdapterWorkflowFunctions', () => {
it('should retrieve workflow functions', (done) => {
try {
wffunctions = a.iapGetAdapterWorkflowFunctions([]);
try {
assert.notEqual(0, wffunctions.length);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('package.json', () => {
it('should have a package.json', (done) => {
try {
fs.exists('package.json', (val) => {
assert.equal(true, val);
done();
});
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('package.json should be validated', (done) => {
try {
const packageDotJson = require('../../package.json');
// Define the JSON schema for package.json
const packageJsonSchema = {
type: 'object',
properties: {
name: { type: 'string' },
version: { type: 'string' }
// May need to add more properties as needed
},
required: ['name', 'version']
};
const validate = ajv.compile(packageJsonSchema);
const isValid = validate(packageDotJson);
if (isValid === false) {
log.error('The package.json contains errors');
assert.equal(true, isValid);
} else {
assert.equal(true, isValid);
}
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('package.json standard fields should be customized', (done) => {
try {
const packageDotJson = require('../../package.json');
assert.notEqual(-1, packageDotJson.name.indexOf('amazon_route53'));
assert.notEqual(undefined, packageDotJson.version);
assert.notEqual(null, packageDotJson.version);
assert.notEqual('', packageDotJson.version);
assert.notEqual(undefined, packageDotJson.description);
assert.notEqual(null, packageDotJson.description);
assert.notEqual('', packageDotJson.description);
assert.equal('adapter.js', packageDotJson.main);
assert.notEqual(undefined, packageDotJson.wizardVersion);
assert.notEqual(null, packageDotJson.wizardVersion);
assert.notEqual('', packageDotJson.wizardVersion);
assert.notEqual(undefined, packageDotJson.engineVersion);
assert.notEqual(null, packageDotJson.engineVersion);
assert.notEqual('', packageDotJson.engineVersion);
assert.equal('http', packageDotJson.adapterType);
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('package.json proper scripts should be provided', (done) => {
try {
const packageDotJson = require('../../package.json');
assert.notEqual(undefined, packageDotJson.scripts);
assert.notEqual(null, packageDotJson.scripts);
assert.notEqual('', packageDotJson.scripts);
assert.equal('node utils/setup.js', packageDotJson.scripts.preinstall);
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js', packageDotJson.scripts.lint);
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet', packageDotJson.scripts['lint:errors']);
assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
assert.equal('mocha test/unit/adapterTestUnit.js --LOG=error', packageDotJson.scripts['test:unit']);
assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
assert.equal('npm run test:baseunit && npm run test:unit && npm run test:integration', packageDotJson.scripts.test);
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('package.json proper directories should be provided', (done) => {
try {
const packageDotJson = require('../../package.json');
assert.notEqual(undefined, packageDotJson.repository);
assert.notEqual(null, packageDotJson.repository);
assert.notEqual('', packageDotJson.repository);
assert.equal('git', packageDotJson.repository.type);
assert.equal('git@gitlab.com:itentialopensource/adapters/', packageDotJson.repository.url.substring(0, 43));
assert.equal('https://gitlab.com/itentialopensource/adapters/', packageDotJson.homepage.substring(0, 47));
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('package.json proper dependencies should be provided', (done) => {
try {
const packageDotJson = require('../../package.json');
assert.notEqual(undefined, packageDotJson.dependencies);
assert.notEqual(null, packageDotJson.dependencies);
assert.notEqual('', packageDotJson.dependencies);
assert.equal('8.20.0', packageDotJson.dependencies.ajv);
assert.equal('1.18.1', packageDotJson.dependencies.axios);
assert.equal('11.1.0', packageDotJson.dependencies.commander);
assert.equal('11.3.6', packageDotJson.dependencies['fs-extra']);
assert.equal('12.0.0-rc.5', packageDotJson.dependencies.mocha);
assert.equal('2.0.1', packageDotJson.dependencies['mocha-param']);
assert.equal('0.4.4', packageDotJson.dependencies.ping);
assert.equal('1.4.10', packageDotJson.dependencies['readline-sync']);
assert.equal('7.7.2', packageDotJson.dependencies.semver);
assert.equal('3.17.0', packageDotJson.dependencies.winston);
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('package.json proper dev dependencies should be provided', (done) => {
try {
const packageDotJson = require('../../package.json');
assert.notEqual(undefined, packageDotJson.devDependencies);
assert.notEqual(null, packageDotJson.devDependencies);
assert.notEqual('', packageDotJson.devDependencies);
assert.equal('4.5.0', packageDotJson.devDependencies.chai);
assert.equal('8.57.0', packageDotJson.devDependencies.eslint);
assert.equal('15.0.0', packageDotJson.devDependencies['eslint-config-airbnb-base']);
assert.equal('2.31.0', packageDotJson.devDependencies['eslint-plugin-import']);
assert.equal('3.1.0', packageDotJson.devDependencies['eslint-plugin-json']);
assert.equal('3.18.0', packageDotJson.devDependencies.testdouble);
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('pronghorn.json', () => {
it('should have a pronghorn.json', (done) => {
try {
fs.exists('pronghorn.json', (val) => {
assert.equal(true, val);
done();
});
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('pronghorn.json should be customized', (done) => {
try {
const pronghornDotJson = require('../../pronghorn.json');
assert.notEqual(-1, pronghornDotJson.id.indexOf('amazon_route53'));
assert.equal('Adapter', pronghornDotJson.type);
assert.equal('AmazonRoute53', pronghornDotJson.export);
assert.equal('Amazon_route53', pronghornDotJson.title);
assert.equal('adapter.js', pronghornDotJson.src);
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('pronghorn.json should contain generic adapter methods', (done) => {
try {
const pronghornDotJson = require('../../pronghorn.json');
assert.notEqual(undefined, pronghornDotJson.methods);
assert.notEqual(null, pronghornDotJson.methods);
assert.notEqual('', pronghornDotJson.methods);
assert.equal(true, Array.isArray(pronghornDotJson.methods));
assert.notEqual(0, pronghornDotJson.methods.length);
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUpdateAdapterConfiguration'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapSuspendAdapter'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUnsuspendAdapter'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetAdapterQueue'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapFindAdapterPath'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapTroubleshootAdapter'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterHealthcheck'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterConnectivity'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterBasicGet'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapMoveAdapterEntitiesToDB'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapDeactivateTasks'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapActivateTasks'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapPopulateEntityCache'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRetrieveEntitiesCache'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'getDevice'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'getDevicesFiltered'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'isAlive'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'getConfig'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetDeviceCount'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapExpandedGenericAdapterRequest'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequest'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequestNoBasePath'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterLint'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterTests'));
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetAdapterInventory'));
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('pronghorn.json should only expose workflow functions', (done) => {
try {
const pronghornDotJson = require('../../pronghorn.json');
for (let m = 0; m < pronghornDotJson.methods.length; m += 1) {
let found = false;
let paramissue = false;
for (let w = 0; w < wffunctions.length; w += 1) {
if (pronghornDotJson.methods[m].name === wffunctions[w]) {
found = true;
const methLine = execute(`grep " ${wffunctions[w]}(" adapter.js | grep "callback) {"`).toString();
let wfparams = [];
if (methLine && methLine.indexOf('(') >= 0 && methLine.indexOf(')') >= 0) {
const temp = methLine.substring(methLine.indexOf('(') + 1, methLine.lastIndexOf(')'));
wfparams = temp.split(',');
for (let t = 0; t < wfparams.length; t += 1) {
// remove default value from the parameter name
wfparams[t] = wfparams[t].substring(0, wfparams[t].search(/=/) > 0 ? wfparams[t].search(/#|\?|=/) : wfparams[t].length);
// remove spaces
wfparams[t] = wfparams[t].trim();
if (wfparams[t] === 'callback') {
wfparams.splice(t, 1);
}
}
}
// if there are inputs defined but not on the method line
if (wfparams.length === 0 && (pronghornDotJson.methods[m].input
&& pronghornDotJson.methods[m].input.length > 0)) {
paramissue = true;
} else if (wfparams.length > 0 && (!pronghornDotJson.methods[m].input
|| pronghornDotJson.methods[m].input.length === 0)) {
// if there are no inputs defined but there are on the method line
paramissue = true;
} else {
for (let p = 0; p < pronghornDotJson.methods[m].input.length; p += 1) {
let pfound = false;
for (let wfp = 0; wfp < wfparams.length; wfp += 1) {
if (pronghornDotJson.methods[m].input[p].name.toUpperCase() === wfparams[wfp].toUpperCase()) {
pfound = true;
}
}
if (!pfound) {
paramissue = true;
}
}
for (let wfp = 0; wfp < wfparams.length; wfp += 1) {
let pfound = false;
for (let p = 0; p < pronghornDotJson.methods[m].input.length; p += 1) {
if (pronghornDotJson.methods[m].input[p].name.toUpperCase() === wfparams[wfp].toUpperCase()) {
pfound = true;
}
}
if (!pfound) {
paramissue = true;
}
}
}
break;
}
}
if (!found) {
// this is the reason to go through both loops - log which ones are not found so
// they can be worked
log.error(`${pronghornDotJson.methods[m].name} not found in workflow functions`);
}
if (paramissue) {
// this is the reason to go through both loops - log which ones are not found so
// they can be worked
log.error(`${pronghornDotJson.methods[m].name} has a parameter mismatch`);
}
assert.equal(true, found);
assert.equal(false, paramissue);
}
done();
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('pronghorn.json should expose all workflow functions', (done) => {
try {
const pronghornDotJson = require('../../pronghorn.json');
for (let w = 0; w < wffunctions.length; w += 1) {
let found = false;
for (let m = 0; m < pronghornDotJson.methods.length; m += 1) {
if (pronghornDotJson.methods[m].name === wffunctions[w]) {
found = true;
break;
}
}
if (!found) {
// this is the reason to go through both loops - log which ones are not found so
// they can be worked
log.error(`${wffunctions[w]} not found in pronghorn.json`);
}
assert.equal(true, found);
}
done();
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
});
it('pronghorn.json verify input/output schema objects', (done) => {
const verifySchema = (methodName, schema) => {
try {
ajv.compile(schema);
} catch (error) {
const errorMessage = `Invalid schema found in '${methodName}' method.
Schema => ${JSON.stringify(schema)}.
Details => ${error.message}`;
throw new Error(errorMessage);
}
};
try {
const pronghornDotJson = require('../../pronghorn.json');
const { methods } = pronghornDotJson;
for (let i = 0; i < methods.length; i += 1) {
for (let j = 0; j < methods[i].input.length; j += 1) {
const inputSchema = methods[i].input[j].schema;
if (inputSchema) {
verifySchema(methods[i].name, inputSchema);
}
}
const outputSchema = methods[i].output.schema;
if (outputSchema) {
verifySchema(methods[i].name, outputSchema);
}
}
done();
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('propertiesSchema.json', () => {
it('should have a propertiesSchema.json', (done) => {
try {
fs.exists('propertiesSchema.json', (val) => {
assert.equal(true, val);
done();
});
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('propertiesSchema.json should be customized', (done) => {
try {
const propertiesDotJson = require('../../propertiesSchema.json');
assert.equal('adapter-amazon_route53', propertiesDotJson.$id);
assert.equal('object', propertiesDotJson.type);
assert.equal('http://json-schema.org/draft-07/schema#', propertiesDotJson.$schema);
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('propertiesSchema.json should contain generic adapter properties', (done) => {
try {
const propertiesDotJson = require('../../propertiesSchema.json');
assert.notEqual(undefined, propertiesDotJson.properties);
assert.notEqual(null, propertiesDotJson.properties);
assert.notEqual('', propertiesDotJson.properties);
assert.equal('string', propertiesDotJson.properties.host.type);
assert.equal('integer', propertiesDotJson.properties.port.type);
assert.equal('boolean', propertiesDotJson.properties.stub.type);
assert.equal('string', propertiesDotJson.properties.protocol.type);
assert.notEqual(undefined, propertiesDotJson.definitions.authentication);
assert.notEqual(null, propertiesDotJson.definitions.authentication);
assert.notEqual('', propertiesDotJson.definitions.authentication);
assert.equal('string', propertiesDotJson.definitions.authentication.properties.auth_method.type);
assert.equal('string', propertiesDotJson.definitions.authentication.properties.username.type);
assert.equal('string', propertiesDotJson.definitions.authentication.properties.password.type);
assert.equal('string', propertiesDotJson.definitions.authentication.properties.token.type);
assert.equal('integer', propertiesDotJson.definitions.authentication.properties.invalid_token_error.type);
assert.equal('integer', propertiesDotJson.definitions.authentication.properties.token_timeout.type);
assert.equal('string', propertiesDotJson.definitions.authentication.properties.token_cache.type);
assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field.type));
assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field_format.type));
assert.equal('boolean', propertiesDotJson.definitions.authentication.properties.auth_logging.type);
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_id.type);
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_secret.type);
assert.equal('string', propertiesDotJson.definitions.authentication.properties.grant_type.type);
assert.equal('string', propertiesDotJson.definitions.authentication.properties.auth_request_datatype.type);
assert.equal('string', propertiesDotJson.definitions.authentication.properties.auth_response_datatype.type);
assert.equal('string', propertiesDotJson.definitions.authentication.properties.token_response_placement.type);
assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
assert.notEqual(null, propertiesDotJson.definitions.ssl);
assert.notEqual('', propertiesDotJson.definitions.ssl);
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ecdhCurve.type);
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.enabled.type);
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.accept_invalid_cert.type);
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ca_file.type);
assert.equal('string', propertiesDotJson.definitions.ssl.properties.key_file.type);
assert.equal('string', propertiesDotJson.definitions.ssl.properties.cert_file.type);
assert.equal('string', propertiesDotJson.definitions.ssl.properties.secure_protocol.type);
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ciphers.type);
assert.equal('string', propertiesDotJson.properties.base_path.type);
assert.equal('string', propertiesDotJson.properties.version.type);
assert.equal('string', propertiesDotJson.properties.cache_location.type);
assert.equal('boolean', propertiesDotJson.properties.encode_pathvars.type);
assert.equal('boolean', propertiesDotJson.properties.encode_queryvars.type);
assert.equal(true, Array.isArray(propertiesDotJson.properties.save_metric.type));
assert.notEqual(undefined, propertiesDotJson.definitions);
assert.notEqual(null, propertiesDotJson.definitions);
assert.notEqual('', propertiesDotJson.definitions);
assert.notEqual(undefined, propertiesDotJson.definitions.healthcheck);
assert.notEqual(null, propertiesDotJson.definitions.healthcheck);
assert.notEqual('', propertiesDotJson.definitions.healthcheck);
assert.equal('string', propertiesDotJson.definitions.healthcheck.properties.type.type);
assert.equal('integer', propertiesDotJson.definitions.healthcheck.properties.frequency.type);
assert.equal('object', propertiesDotJson.definitions.healthcheck.properties.query_object.type);
assert.notEqual(undefined, propertiesDotJson.definitions.throttle);
assert.notEqual(null, propertiesDotJson.definitions.throttle);
assert.notEqual('', propertiesDotJson.definitions.throttle);
assert.equal('boolean', propertiesDotJson.definitions.throttle.properties.throttle_enabled.type);
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.number_pronghorns.type);
assert.equal('string', propertiesDotJson.definitions.throttle.properties.sync_async.type);
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.max_in_queue.type);
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.concurrent_max.type);
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.expire_timeout.type);
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.avg_runtime.type);
assert.equal('array', propertiesDotJson.definitions.throttle.properties.priorities.type);
assert.notEqual(undefined, propertiesDotJson.definitions.request);
assert.notEqual(null, propertiesDotJson.definitions.request);
assert.notEqual('', propertiesDotJson.definitions.request);
assert.equal('integer', propertiesDotJson.definitions.request.properties.number_redirects.type);
assert.equal('integer', propertiesDotJson.definitions.request.properties.number_retries.type);
assert.equal(true, Array.isArray(propertiesDotJson.definitions.request.properties.limit_retry_error.type));
assert.equal('array', propertiesDotJson.definitions.request.properties.failover_codes.type);
assert.equal('integer', propertiesDotJson.definitions.request.properties.attempt_timeout.type);
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.type);
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.payload.type);
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.uriOptions.type);
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.addlHeaders.type);
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.authData.type);
assert.equal('boolean', propertiesDotJson.definitions.request.properties.healthcheck_on_timeout.type);
assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_raw.type);
assert.equal('boolean', propertiesDotJson.definitions.request.properties.archiving.type);
assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_request.type);
assert.notEqual(undefined, propertiesDotJson.definitions.proxy);
assert.notEqual(null, propertiesDotJson.definitions.proxy);
assert.notEqual('', propertiesDotJson.definitions.proxy);
assert.equal('boolean', propertiesDotJson.definitions.proxy.properties.enabled.type);
assert.equal('string', propertiesDotJson.definitions.proxy.properties.host.type);
assert.equal('integer', propertiesDotJson.definitions.proxy.properties.port.type);
assert.equal('string', propertiesDotJson.definitions.proxy.properties.protocol.type);
assert.equal('string', propertiesDotJson.definitions.proxy.properties.username.type);
assert.equal('string', propertiesDotJson.definitions.proxy.properties.password.type);
assert.notEqual(undefined, propertiesDotJson.definitions.mongo);
assert.notEqual(null, propertiesDotJson.definitions.mongo);
assert.notEqual('', propertiesDotJson.definitions.mongo);
assert.equal('string', propertiesDotJson.definitions.mongo.properties.host.type);
assert.equal('integer', propertiesDotJson.definitions.mongo.properties.port.type);
assert.equal('string', propertiesDotJson.definitions.mongo.properties.database.type);
assert.equal('string', propertiesDotJson.definitions.mongo.properties.username.type);
assert.equal('string', propertiesDotJson.definitions.mongo.properties.password.type);
assert.equal('string', propertiesDotJson.definitions.mongo.properties.replSet.type);
assert.equal('object', propertiesDotJson.definitions.mongo.properties.db_ssl.type);
assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.enabled.type);
assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.accept_invalid_cert.type);
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.ca_file.type);
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.key_file.type);
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.cert_file.type);
assert.notEqual('', propertiesDotJson.definitions.devicebroker);
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevice.type);
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevicesFiltered.type);
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.isAlive.type);
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getConfig.type);
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getCount.type);
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('error.json', () => {
it('should have an error.json', (done) => {
try {
fs.exists('error.json', (val) => {
assert.equal(true, val);
done();
});
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('error.json should have standard adapter errors', (done) => {
try {
const errorDotJson = require('../../error.json');
assert.notEqual(undefined, errorDotJson.errors);
assert.notEqual(null, errorDotJson.errors);
assert.notEqual('', errorDotJson.errors);
assert.equal(true, Array.isArray(errorDotJson.errors));
assert.notEqual(0, errorDotJson.errors.length);
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.100'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.101'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.102'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.110'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.111'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.112'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.113'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.114'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.115'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.116'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.300'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.301'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.302'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.303'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.304'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.305'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.310'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.311'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.312'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.320'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.321'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.400'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.401'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.402'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.500'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.501'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.502'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.503'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.600'));
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.900'));
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('sampleProperties.json', () => {
it('should have a sampleProperties.json', (done) => {
try {
fs.exists('sampleProperties.json', (val) => {
assert.equal(true, val);
done();
});
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('sampleProperties.json should contain generic adapter properties', (done) => {
try {
const sampleDotJson = require('../../sampleProperties.json');
assert.notEqual(-1, sampleDotJson.id.indexOf('amazon_route53'));
assert.equal('AmazonRoute53', sampleDotJson.type);
assert.notEqual(undefined, sampleDotJson.properties);
assert.notEqual(null, sampleDotJson.properties);
assert.notEqual('', sampleDotJson.properties);
assert.notEqual(undefined, sampleDotJson.properties.host);
assert.notEqual(undefined, sampleDotJson.properties.port);
assert.notEqual(undefined, sampleDotJson.properties.stub);
assert.notEqual(undefined, sampleDotJson.properties.protocol);
assert.notEqual(undefined, sampleDotJson.properties.authentication);
assert.notEqual(null, sampleDotJson.properties.authentication);
assert.notEqual('', sampleDotJson.properties.authentication);
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_method);
assert.notEqual(undefined, sampleDotJson.properties.authentication.username);
assert.notEqual(undefined, sampleDotJson.properties.authentication.password);
assert.notEqual(undefined, sampleDotJson.properties.authentication.token);
assert.notEqual(undefined, sampleDotJson.properties.authentication.invalid_token_error);
assert.notEqual(undefined, sampleDotJson.properties.authentication.token_timeout);
assert.notEqual(undefined, sampleDotJson.properties.authentication.token_cache);
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field);
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field_format);
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_logging);
assert.notEqual(undefined, sampleDotJson.properties.authentication.client_id);
assert.notEqual(undefined, sampleDotJson.properties.authentication.client_secret);
assert.notEqual(undefined, sampleDotJson.properties.authentication.grant_type);
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_request_datatype);
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_response_datatype);
assert.notEqual(undefined, sampleDotJson.properties.authentication.token_response_placement);
assert.notEqual(undefined, sampleDotJson.properties.ssl);
assert.notEqual(null, sampleDotJson.properties.ssl);
assert.notEqual('', sampleDotJson.properties.ssl);
assert.notEqual(undefined, sampleDotJson.properties.ssl.ecdhCurve);
assert.notEqual(undefined, sampleDotJson.properties.ssl.enabled);
assert.notEqual(undefined, sampleDotJson.properties.ssl.accept_invalid_cert);
assert.notEqual(undefined, sampleDotJson.properties.ssl.ca_file);
assert.notEqual(undefined, sampleDotJson.properties.ssl.key_file);
assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
assert.notEqual(undefined, sampleDotJson.properties.base_path);
assert.notEqual(undefined, sampleDotJson.properties.version);
assert.notEqual(undefined, sampleDotJson.properties.cache_location);
assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
assert.notEqual(undefined, sampleDotJson.properties.encode_queryvars);
assert.notEqual(undefined, sampleDotJson.properties.save_metric);
assert.notEqual(undefined, sampleDotJson.properties.healthcheck);
assert.notEqual(null, sampleDotJson.properties.healthcheck);
assert.notEqual('', sampleDotJson.properties.healthcheck);
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.type);
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.frequency);
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.query_object);
assert.notEqual(undefined, sampleDotJson.properties.throttle);
assert.notEqual(null, sampleDotJson.properties.throttle);
assert.notEqual('', sampleDotJson.properties.throttle);
assert.notEqual(undefined, sampleDotJson.properties.throttle.throttle_enabled);
assert.notEqual(undefined, sampleDotJson.properties.throttle.number_pronghorns);
assert.notEqual(undefined, sampleDotJson.properties.throttle.sync_async);
assert.notEqual(undefined, sampleDotJson.properties.throttle.max_in_queue);
assert.notEqual(undefined, sampleDotJson.properties.throttle.concurrent_max);
assert.notEqual(undefined, sampleDotJson.properties.throttle.expire_timeout);
assert.notEqual(undefined, sampleDotJson.properties.throttle.avg_runtime);
assert.notEqual(undefined, sampleDotJson.properties.throttle.priorities);
assert.notEqual(undefined, sampleDotJson.properties.request);
assert.notEqual(null, sampleDotJson.properties.request);
assert.notEqual('', sampleDotJson.properties.request);
assert.notEqual(undefined, sampleDotJson.properties.request.number_redirects);
assert.notEqual(undefined, sampleDotJson.properties.request.number_retries);
assert.notEqual(undefined, sampleDotJson.properties.request.limit_retry_error);
assert.notEqual(undefined, sampleDotJson.properties.request.failover_codes);
assert.notEqual(undefined, sampleDotJson.properties.request.attempt_timeout);
assert.notEqual(undefined, sampleDotJson.properties.request.global_request);
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.payload);
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.uriOptions);
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.addlHeaders);
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.authData);
assert.notEqual(undefined, sampleDotJson.properties.request.healthcheck_on_timeout);
assert.notEqual(undefined, sampleDotJson.properties.request.return_raw);
assert.notEqual(undefined, sampleDotJson.properties.request.archiving);
assert.notEqual(undefined, sampleDotJson.properties.request.return_request);
assert.notEqual(undefined, sampleDotJson.properties.proxy);
assert.notEqual(null, sampleDotJson.properties.proxy);
assert.notEqual('', sampleDotJson.properties.proxy);
assert.notEqual(undefined, sampleDotJson.properties.proxy.enabled);
assert.notEqual(undefined, sampleDotJson.properties.proxy.host);
assert.notEqual(undefined, sampleDotJson.properties.proxy.port);
assert.notEqual(undefined, sampleDotJson.properties.proxy.protocol);
assert.notEqual(undefined, sampleDotJson.properties.proxy.username);
assert.notEqual(undefined, sampleDotJson.properties.proxy.password);
assert.notEqual(undefined, sampleDotJson.properties.mongo);
assert.notEqual(null, sampleDotJson.properties.mongo);
assert.notEqual('', sampleDotJson.properties.mongo);
assert.notEqual(undefined, sampleDotJson.properties.mongo.host);
assert.notEqual(undefined, sampleDotJson.properties.mongo.port);
assert.notEqual(undefined, sampleDotJson.properties.mongo.database);
assert.notEqual(undefined, sampleDotJson.properties.mongo.username);
assert.notEqual(undefined, sampleDotJson.properties.mongo.password);
assert.notEqual(undefined, sampleDotJson.properties.mongo.replSet);
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl);
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.enabled);
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.accept_invalid_cert);
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.ca_file);
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.key_file);
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.cert_file);
assert.notEqual(undefined, sampleDotJson.properties.devicebroker);
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevice);
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevicesFiltered);
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.isAlive);
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getConfig);
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getCount);
assert.notEqual(undefined, sampleDotJson.properties.cache);
assert.notEqual(undefined, sampleDotJson.properties.cache.entities);
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#checkProperties', () => {
it('should have a checkProperties function', (done) => {
try {
assert.equal(true, typeof a.checkProperties === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('the sample properties should be good - if failure change the log level', (done) => {
try {
const samplePropsJson = require('../../sampleProperties.json');
const clean = a.checkProperties(samplePropsJson.properties);
try {
assert.notEqual(0, Object.keys(clean));
assert.equal(undefined, clean.exception);
assert.notEqual(undefined, clean.host);
assert.notEqual(null, clean.host);
assert.notEqual('', clean.host);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('README.md', () => {
it('should have a README', (done) => {
try {
fs.exists('README.md', (val) => {
assert.equal(true, val);
done();
});
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('README.md should be customized', (done) => {
try {
fs.readFile('README.md', 'utf8', (err, data) => {
assert.equal(-1, data.indexOf('[System]'));
assert.equal(-1, data.indexOf('[system]'));
assert.equal(-1, data.indexOf('[version]'));
assert.equal(-1, data.indexOf('[namespace]'));
done();
});
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#connect', () => {
it('should have a connect function', (done) => {
try {
assert.equal(true, typeof a.connect === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#healthCheck', () => {
it('should have a healthCheck function', (done) => {
try {
assert.equal(true, typeof a.healthCheck === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#iapUpdateAdapterConfiguration', () => {
it('should have a iapUpdateAdapterConfiguration function', (done) => {
try {
assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#iapSuspendAdapter', () => {
it('should have a iapSuspendAdapter function', (done) => {
try {
assert.equal(true, typeof a.iapSuspendAdapter === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#iapUnsuspendAdapter', () => {
it('should have a iapUnsuspendAdapter function', (done) => {
try {
assert.equal(true, typeof a.iapUnsuspendAdapter === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#iapGetAdapterQueue', () => {
it('should have a iapGetAdapterQueue function', (done) => {
try {
assert.equal(true, typeof a.iapGetAdapterQueue === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#iapFindAdapterPath', () => {
it('should have a iapFindAdapterPath function', (done) => {
try {
assert.equal(true, typeof a.iapFindAdapterPath === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('iapFindAdapterPath should find atleast one path that matches', (done) => {
try {
a.iapFindAdapterPath('{base_path}/{version}', (data, error) => {
try {
assert.equal(undefined, error);
assert.notEqual(undefined, data);
assert.notEqual(null, data);
assert.equal(true, data.found);
assert.notEqual(undefined, data.foundIn);
assert.notEqual(null, data.foundIn);
assert.notEqual(0, data.foundIn.length);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#iapTroubleshootAdapter', () => {
it('should have a iapTroubleshootAdapter function', (done) => {
try {
assert.equal(true, typeof a.iapTroubleshootAdapter === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#iapRunAdapterHealthcheck', () => {
it('should have a iapRunAdapterHealthcheck function', (done) => {
try {
assert.equal(true, typeof a.iapRunAdapterHealthcheck === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#iapRunAdapterConnectivity', () => {
it('should have a iapRunAdapterConnectivity function', (done) => {
try {
assert.equal(true, typeof a.iapRunAdapterConnectivity === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#iapRunAdapterBasicGet', () => {
it('should have a iapRunAdapterBasicGet function', (done) => {
try {
assert.equal(true, typeof a.iapRunAdapterBasicGet === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#iapMoveAdapterEntitiesToDB', () => {
it('should have a iapMoveAdapterEntitiesToDB function', (done) => {
try {
assert.equal(true, typeof a.iapMoveAdapterEntitiesToDB === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#checkActionFiles', () => {
it('should have a checkActionFiles function', (done) => {
try {
assert.equal(true, typeof a.checkActionFiles === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('the action files should be good - if failure change the log level as most issues are warnings', (done) => {
try {
const clean = a.checkActionFiles();
try {
for (let c = 0; c < clean.length; c += 1) {
log.error(clean[c]);
}
assert.equal(0, clean.length);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#encryptProperty', () => {
it('should have a encryptProperty function', (done) => {
try {
assert.equal(true, typeof a.encryptProperty === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('should get base64 encoded property', (done) => {
try {
a.encryptProperty('testing', 'base64', (data, error) => {
try {
assert.equal(undefined, error);
assert.notEqual(undefined, data);
assert.notEqual(null, data);
assert.notEqual(undefined, data.response);
assert.notEqual(null, data.response);
assert.equal(0, data.response.indexOf('{code}'));
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should get encrypted property', (done) => {
try {
a.encryptProperty('testing', 'encrypt', (data, error) => {
try {
assert.equal(undefined, error);
assert.notEqual(undefined, data);
assert.notEqual(null, data);
assert.notEqual(undefined, data.response);
assert.notEqual(null, data.response);
assert.equal(0, data.response.indexOf('{crypt}'));
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#iapDeactivateTasks', () => {
it('should have a iapDeactivateTasks function', (done) => {
try {
assert.equal(true, typeof a.iapDeactivateTasks === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#iapActivateTasks', () => {
it('should have a iapActivateTasks function', (done) => {
try {
assert.equal(true, typeof a.iapActivateTasks === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#iapPopulateEntityCache', () => {
it('should have a iapPopulateEntityCache function', (done) => {
try {
assert.equal(true, typeof a.iapPopulateEntityCache === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#iapRetrieveEntitiesCache', () => {
it('should have a iapRetrieveEntitiesCache function', (done) => {
try {
assert.equal(true, typeof a.iapRetrieveEntitiesCache === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#hasEntities', () => {
it('should have a hasEntities function', (done) => {
try {
assert.equal(true, typeof a.hasEntities === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#getDevice', () => {
it('should have a getDevice function', (done) => {
try {
assert.equal(true, typeof a.getDevice === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#getDevicesFiltered', () => {
it('should have a getDevicesFiltered function', (done) => {
try {
assert.equal(true, typeof a.getDevicesFiltered === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#isAlive', () => {
it('should have a isAlive function', (done) => {
try {
assert.equal(true, typeof a.isAlive === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#getConfig', () => {
it('should have a getConfig function', (done) => {
try {
assert.equal(true, typeof a.getConfig === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#iapGetDeviceCount', () => {
it('should have a iapGetDeviceCount function', (done) => {
try {
assert.equal(true, typeof a.iapGetDeviceCount === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#iapExpandedGenericAdapterRequest', () => {
it('should have a iapExpandedGenericAdapterRequest function', (done) => {
try {
assert.equal(true, typeof a.iapExpandedGenericAdapterRequest === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#genericAdapterRequest', () => {
it('should have a genericAdapterRequest function', (done) => {
try {
assert.equal(true, typeof a.genericAdapterRequest === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#genericAdapterRequestNoBasePath', () => {
it('should have a genericAdapterRequestNoBasePath function', (done) => {
try {
assert.equal(true, typeof a.genericAdapterRequestNoBasePath === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#iapRunAdapterLint', () => {
it('should have a iapRunAdapterLint function', (done) => {
try {
assert.equal(true, typeof a.iapRunAdapterLint === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('retrieve the lint results', (done) => {
try {
a.iapRunAdapterLint((data, error) => {
try {
assert.equal(undefined, error);
assert.notEqual(undefined, data);
assert.notEqual(null, data);
assert.notEqual(undefined, data.status);
assert.notEqual(null, data.status);
assert.equal('SUCCESS', data.status);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#iapRunAdapterTests', () => {
it('should have a iapRunAdapterTests function', (done) => {
try {
assert.equal(true, typeof a.iapRunAdapterTests === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
describe('#iapGetAdapterInventory', () => {
it('should have a iapGetAdapterInventory function', (done) => {
try {
assert.equal(true, typeof a.iapGetAdapterInventory === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('retrieve the inventory', (done) => {
try {
a.iapGetAdapterInventory((data, error) => {
try {
assert.equal(undefined, error);
assert.notEqual(undefined, data);
assert.notEqual(null, data);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('metadata.json', () => {
it('should have a metadata.json', (done) => {
try {
fs.exists('metadata.json', (val) => {
assert.equal(true, val);
done();
});
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('metadata.json is customized', (done) => {
try {
const metadataDotJson = require('../../metadata.json');
assert.equal('adapter-amazon_route53', metadataDotJson.name);
assert.notEqual(undefined, metadataDotJson.webName);
assert.notEqual(null, metadataDotJson.webName);
assert.notEqual('', metadataDotJson.webName);
assert.equal('Adapter', metadataDotJson.type);
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('metadata.json contains accurate documentation', (done) => {
try {
const metadataDotJson = require('../../metadata.json');
assert.notEqual(undefined, metadataDotJson.documentation);
assert.equal('https://www.npmjs.com/package/@itentialopensource/adapter-amazon_route53', metadataDotJson.documentation.npmLink);
assert.equal('https://docs.itential.com/opensource/docs/troubleshooting-an-adapter', metadataDotJson.documentation.faqLink);
assert.equal('https://gitlab.com/itentialopensource/adapters/contributing-guide', metadataDotJson.documentation.contributeLink);
assert.equal('https://itential.atlassian.net/servicedesk/customer/portals', metadataDotJson.documentation.issueLink);
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
it('metadata.json has related items', (done) => {
try {
const metadataDotJson = require('../../metadata.json');
assert.notEqual(undefined, metadataDotJson.relatedItems);
assert.notEqual(undefined, metadataDotJson.relatedItems.adapters);
assert.notEqual(undefined, metadataDotJson.relatedItems.integrations);
assert.notEqual(undefined, metadataDotJson.relatedItems.ecosystemApplications);
assert.notEqual(undefined, metadataDotJson.relatedItems.workflowProjects);
assert.notEqual(undefined, metadataDotJson.relatedItems.transformationProjects);
assert.notEqual(undefined, metadataDotJson.relatedItems.exampleProjects);
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
});
});
/*
-----------------------------------------------------------------------
-----------------------------------------------------------------------
*** All code above this comment will be replaced during a migration ***
******************* DO NOT REMOVE THIS COMMENT BLOCK ******************
-----------------------------------------------------------------------
-----------------------------------------------------------------------
*/
describe('#activateKeySigningKey - errors', () => {
it('should have a activateKeySigningKey function', (done) => {
try {
assert.equal(true, typeof a.activateKeySigningKey === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing hostedZoneId', (done) => {
try {
a.activateKeySigningKey(null, null, (data, error) => {
try {
const displayE = 'hostedZoneId is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-activateKeySigningKeySTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing name', (done) => {
try {
a.activateKeySigningKey('fakeparam', null, (data, error) => {
try {
const displayE = 'name is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-activateKeySigningKeySTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#associateVPCWithHostedZone - errors', () => {
it('should have a associateVPCWithHostedZone function', (done) => {
try {
assert.equal(true, typeof a.associateVPCWithHostedZone === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.associateVPCWithHostedZone(null, null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-associateVPCWithHostedZoneSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.associateVPCWithHostedZone('fakeparam', null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-associateVPCWithHostedZoneSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#changeResourceRecordSets - errors', () => {
it('should have a changeResourceRecordSets function', (done) => {
try {
assert.equal(true, typeof a.changeResourceRecordSets === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.changeResourceRecordSets(null, null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-changeResourceRecordSetsSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.changeResourceRecordSets('fakeparam', null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-changeResourceRecordSetsSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#changeTagsForResource - errors', () => {
it('should have a changeTagsForResource function', (done) => {
try {
assert.equal(true, typeof a.changeTagsForResource === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing resourceType', (done) => {
try {
a.changeTagsForResource(null, null, null, (data, error) => {
try {
const displayE = 'resourceType is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-changeTagsForResourceSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing resourceId', (done) => {
try {
a.changeTagsForResource('fakeparam', null, null, (data, error) => {
try {
const displayE = 'resourceId is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-changeTagsForResourceSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.changeTagsForResource('fakeparam', 'fakeparam', null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-changeTagsForResourceSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#listTagsForResource - errors', () => {
it('should have a listTagsForResource function', (done) => {
try {
assert.equal(true, typeof a.listTagsForResource === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing resourceType', (done) => {
try {
a.listTagsForResource(null, null, (data, error) => {
try {
const displayE = 'resourceType is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-listTagsForResourceSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing resourceId', (done) => {
try {
a.listTagsForResource('fakeparam', null, (data, error) => {
try {
const displayE = 'resourceId is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-listTagsForResourceSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#createHealthCheck - errors', () => {
it('should have a createHealthCheck function', (done) => {
try {
assert.equal(true, typeof a.createHealthCheck === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.createHealthCheck(null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-createHealthCheckSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#listHealthChecks - errors', () => {
it('should have a listHealthChecks function', (done) => {
try {
assert.equal(true, typeof a.listHealthChecks === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#createHostedZone - errors', () => {
it('should have a createHostedZone function', (done) => {
try {
assert.equal(true, typeof a.createHostedZone === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.createHostedZone(null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-createHostedZoneSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#listHostedZones - errors', () => {
it('should have a listHostedZones function', (done) => {
try {
assert.equal(true, typeof a.listHostedZones === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#createKeySigningKey - errors', () => {
it('should have a createKeySigningKey function', (done) => {
try {
assert.equal(true, typeof a.createKeySigningKey === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.createKeySigningKey(null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-createKeySigningKeySTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#createQueryLoggingConfig - errors', () => {
it('should have a createQueryLoggingConfig function', (done) => {
try {
assert.equal(true, typeof a.createQueryLoggingConfig === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.createQueryLoggingConfig(null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-createQueryLoggingConfigSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#listQueryLoggingConfigs - errors', () => {
it('should have a listQueryLoggingConfigs function', (done) => {
try {
assert.equal(true, typeof a.listQueryLoggingConfigs === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#createReusableDelegationSet - errors', () => {
it('should have a createReusableDelegationSet function', (done) => {
try {
assert.equal(true, typeof a.createReusableDelegationSet === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.createReusableDelegationSet(null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-createReusableDelegationSetSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#listReusableDelegationSets - errors', () => {
it('should have a listReusableDelegationSets function', (done) => {
try {
assert.equal(true, typeof a.listReusableDelegationSets === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#createTrafficPolicy - errors', () => {
it('should have a createTrafficPolicy function', (done) => {
try {
assert.equal(true, typeof a.createTrafficPolicy === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.createTrafficPolicy(null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-createTrafficPolicySTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#createTrafficPolicyInstance - errors', () => {
it('should have a createTrafficPolicyInstance function', (done) => {
try {
assert.equal(true, typeof a.createTrafficPolicyInstance === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.createTrafficPolicyInstance(null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-createTrafficPolicyInstanceSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#createTrafficPolicyVersion - errors', () => {
it('should have a createTrafficPolicyVersion function', (done) => {
try {
assert.equal(true, typeof a.createTrafficPolicyVersion === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.createTrafficPolicyVersion(null, null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-createTrafficPolicyVersionSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.createTrafficPolicyVersion('fakeparam', null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-createTrafficPolicyVersionSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#createVPCAssociationAuthorization - errors', () => {
it('should have a createVPCAssociationAuthorization function', (done) => {
try {
assert.equal(true, typeof a.createVPCAssociationAuthorization === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.createVPCAssociationAuthorization(null, null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-createVPCAssociationAuthorizationSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.createVPCAssociationAuthorization('fakeparam', null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-createVPCAssociationAuthorizationSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#listVPCAssociationAuthorizations - errors', () => {
it('should have a listVPCAssociationAuthorizations function', (done) => {
try {
assert.equal(true, typeof a.listVPCAssociationAuthorizations === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.listVPCAssociationAuthorizations(null, null, null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-listVPCAssociationAuthorizationsSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#deactivateKeySigningKey - errors', () => {
it('should have a deactivateKeySigningKey function', (done) => {
try {
assert.equal(true, typeof a.deactivateKeySigningKey === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing hostedZoneId', (done) => {
try {
a.deactivateKeySigningKey(null, null, (data, error) => {
try {
const displayE = 'hostedZoneId is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-deactivateKeySigningKeySTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing name', (done) => {
try {
a.deactivateKeySigningKey('fakeparam', null, (data, error) => {
try {
const displayE = 'name is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-deactivateKeySigningKeySTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#deleteHealthCheck - errors', () => {
it('should have a deleteHealthCheck function', (done) => {
try {
assert.equal(true, typeof a.deleteHealthCheck === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing healthCheckId', (done) => {
try {
a.deleteHealthCheck(null, (data, error) => {
try {
const displayE = 'healthCheckId is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-deleteHealthCheckSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getHealthCheck - errors', () => {
it('should have a getHealthCheck function', (done) => {
try {
assert.equal(true, typeof a.getHealthCheck === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing healthCheckId', (done) => {
try {
a.getHealthCheck(null, (data, error) => {
try {
const displayE = 'healthCheckId is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-getHealthCheckSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#updateHealthCheck - errors', () => {
it('should have a updateHealthCheck function', (done) => {
try {
assert.equal(true, typeof a.updateHealthCheck === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing healthCheckId', (done) => {
try {
a.updateHealthCheck(null, null, (data, error) => {
try {
const displayE = 'healthCheckId is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-updateHealthCheckSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.updateHealthCheck('fakeparam', null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-updateHealthCheckSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#deleteHostedZone - errors', () => {
it('should have a deleteHostedZone function', (done) => {
try {
assert.equal(true, typeof a.deleteHostedZone === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.deleteHostedZone(null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-deleteHostedZoneSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getHostedZone - errors', () => {
it('should have a getHostedZone function', (done) => {
try {
assert.equal(true, typeof a.getHostedZone === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.getHostedZone(null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-getHostedZoneSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#updateHostedZoneComment - errors', () => {
it('should have a updateHostedZoneComment function', (done) => {
try {
assert.equal(true, typeof a.updateHostedZoneComment === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.updateHostedZoneComment(null, null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-updateHostedZoneCommentSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.updateHostedZoneComment('fakeparam', null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-updateHostedZoneCommentSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#deleteKeySigningKey - errors', () => {
it('should have a deleteKeySigningKey function', (done) => {
try {
assert.equal(true, typeof a.deleteKeySigningKey === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing hostedZoneId', (done) => {
try {
a.deleteKeySigningKey(null, null, (data, error) => {
try {
const displayE = 'hostedZoneId is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-deleteKeySigningKeySTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing name', (done) => {
try {
a.deleteKeySigningKey('fakeparam', null, (data, error) => {
try {
const displayE = 'name is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-deleteKeySigningKeySTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#deleteQueryLoggingConfig - errors', () => {
it('should have a deleteQueryLoggingConfig function', (done) => {
try {
assert.equal(true, typeof a.deleteQueryLoggingConfig === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.deleteQueryLoggingConfig(null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-deleteQueryLoggingConfigSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getQueryLoggingConfig - errors', () => {
it('should have a getQueryLoggingConfig function', (done) => {
try {
assert.equal(true, typeof a.getQueryLoggingConfig === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.getQueryLoggingConfig(null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-getQueryLoggingConfigSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#deleteReusableDelegationSet - errors', () => {
it('should have a deleteReusableDelegationSet function', (done) => {
try {
assert.equal(true, typeof a.deleteReusableDelegationSet === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.deleteReusableDelegationSet(null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-deleteReusableDelegationSetSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getReusableDelegationSet - errors', () => {
it('should have a getReusableDelegationSet function', (done) => {
try {
assert.equal(true, typeof a.getReusableDelegationSet === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.getReusableDelegationSet(null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-getReusableDelegationSetSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#deleteTrafficPolicy - errors', () => {
it('should have a deleteTrafficPolicy function', (done) => {
try {
assert.equal(true, typeof a.deleteTrafficPolicy === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.deleteTrafficPolicy(null, null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-deleteTrafficPolicySTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing version', (done) => {
try {
a.deleteTrafficPolicy('fakeparam', null, (data, error) => {
try {
const displayE = 'version is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-deleteTrafficPolicySTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getTrafficPolicy - errors', () => {
it('should have a getTrafficPolicy function', (done) => {
try {
assert.equal(true, typeof a.getTrafficPolicy === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.getTrafficPolicy(null, null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-getTrafficPolicySTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing version', (done) => {
try {
a.getTrafficPolicy('fakeparam', null, (data, error) => {
try {
const displayE = 'version is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-getTrafficPolicySTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#updateTrafficPolicyComment - errors', () => {
it('should have a updateTrafficPolicyComment function', (done) => {
try {
assert.equal(true, typeof a.updateTrafficPolicyComment === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.updateTrafficPolicyComment(null, null, null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-updateTrafficPolicyCommentSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing version', (done) => {
try {
a.updateTrafficPolicyComment('fakeparam', null, null, (data, error) => {
try {
const displayE = 'version is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-updateTrafficPolicyCommentSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.updateTrafficPolicyComment('fakeparam', 'fakeparam', null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-updateTrafficPolicyCommentSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#deleteTrafficPolicyInstance - errors', () => {
it('should have a deleteTrafficPolicyInstance function', (done) => {
try {
assert.equal(true, typeof a.deleteTrafficPolicyInstance === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.deleteTrafficPolicyInstance(null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-deleteTrafficPolicyInstanceSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getTrafficPolicyInstance - errors', () => {
it('should have a getTrafficPolicyInstance function', (done) => {
try {
assert.equal(true, typeof a.getTrafficPolicyInstance === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.getTrafficPolicyInstance(null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-getTrafficPolicyInstanceSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#updateTrafficPolicyInstance - errors', () => {
it('should have a updateTrafficPolicyInstance function', (done) => {
try {
assert.equal(true, typeof a.updateTrafficPolicyInstance === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.updateTrafficPolicyInstance(null, null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-updateTrafficPolicyInstanceSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.updateTrafficPolicyInstance('fakeparam', null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-updateTrafficPolicyInstanceSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#deleteVPCAssociationAuthorization - errors', () => {
it('should have a deleteVPCAssociationAuthorization function', (done) => {
try {
assert.equal(true, typeof a.deleteVPCAssociationAuthorization === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.deleteVPCAssociationAuthorization(null, null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-deleteVPCAssociationAuthorizationSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.deleteVPCAssociationAuthorization('fakeparam', null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-deleteVPCAssociationAuthorizationSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#disableHostedZoneDNSSEC - errors', () => {
it('should have a disableHostedZoneDNSSEC function', (done) => {
try {
assert.equal(true, typeof a.disableHostedZoneDNSSEC === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.disableHostedZoneDNSSEC(null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-disableHostedZoneDNSSECSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#disassociateVPCFromHostedZone - errors', () => {
it('should have a disassociateVPCFromHostedZone function', (done) => {
try {
assert.equal(true, typeof a.disassociateVPCFromHostedZone === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.disassociateVPCFromHostedZone(null, null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-disassociateVPCFromHostedZoneSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.disassociateVPCFromHostedZone('fakeparam', null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-disassociateVPCFromHostedZoneSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#enableHostedZoneDNSSEC - errors', () => {
it('should have a enableHostedZoneDNSSEC function', (done) => {
try {
assert.equal(true, typeof a.enableHostedZoneDNSSEC === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.enableHostedZoneDNSSEC(null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-enableHostedZoneDNSSECSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getAccountLimit - errors', () => {
it('should have a getAccountLimit function', (done) => {
try {
assert.equal(true, typeof a.getAccountLimit === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing type', (done) => {
try {
a.getAccountLimit(null, (data, error) => {
try {
const displayE = 'type is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-getAccountLimitSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getChange - errors', () => {
it('should have a getChange function', (done) => {
try {
assert.equal(true, typeof a.getChange === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.getChange(null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-getChangeSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getCheckerIpRanges - errors', () => {
it('should have a getCheckerIpRanges function', (done) => {
try {
assert.equal(true, typeof a.getCheckerIpRanges === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getDNSSEC - errors', () => {
it('should have a getDNSSEC function', (done) => {
try {
assert.equal(true, typeof a.getDNSSEC === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.getDNSSEC(null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-getDNSSECSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getGeoLocation - errors', () => {
it('should have a getGeoLocation function', (done) => {
try {
assert.equal(true, typeof a.getGeoLocation === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getHealthCheckCount - errors', () => {
it('should have a getHealthCheckCount function', (done) => {
try {
assert.equal(true, typeof a.getHealthCheckCount === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getHealthCheckLastFailureReason - errors', () => {
it('should have a getHealthCheckLastFailureReason function', (done) => {
try {
assert.equal(true, typeof a.getHealthCheckLastFailureReason === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing healthCheckId', (done) => {
try {
a.getHealthCheckLastFailureReason(null, (data, error) => {
try {
const displayE = 'healthCheckId is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-getHealthCheckLastFailureReasonSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getHealthCheckStatus - errors', () => {
it('should have a getHealthCheckStatus function', (done) => {
try {
assert.equal(true, typeof a.getHealthCheckStatus === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing healthCheckId', (done) => {
try {
a.getHealthCheckStatus(null, (data, error) => {
try {
const displayE = 'healthCheckId is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-getHealthCheckStatusSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getHostedZoneCount - errors', () => {
it('should have a getHostedZoneCount function', (done) => {
try {
assert.equal(true, typeof a.getHostedZoneCount === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getHostedZoneLimit - errors', () => {
it('should have a getHostedZoneLimit function', (done) => {
try {
assert.equal(true, typeof a.getHostedZoneLimit === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing type', (done) => {
try {
a.getHostedZoneLimit(null, null, (data, error) => {
try {
const displayE = 'type is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-getHostedZoneLimitSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.getHostedZoneLimit('fakeparam', null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-getHostedZoneLimitSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getReusableDelegationSetLimit - errors', () => {
it('should have a getReusableDelegationSetLimit function', (done) => {
try {
assert.equal(true, typeof a.getReusableDelegationSetLimit === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing type', (done) => {
try {
a.getReusableDelegationSetLimit(null, null, (data, error) => {
try {
const displayE = 'type is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-getReusableDelegationSetLimitSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.getReusableDelegationSetLimit('fakeparam', null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-getReusableDelegationSetLimitSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#getTrafficPolicyInstanceCount - errors', () => {
it('should have a getTrafficPolicyInstanceCount function', (done) => {
try {
assert.equal(true, typeof a.getTrafficPolicyInstanceCount === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#listGeoLocations - errors', () => {
it('should have a listGeoLocations function', (done) => {
try {
assert.equal(true, typeof a.listGeoLocations === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#listHostedZonesByName - errors', () => {
it('should have a listHostedZonesByName function', (done) => {
try {
assert.equal(true, typeof a.listHostedZonesByName === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#listHostedZonesByVPC - errors', () => {
it('should have a listHostedZonesByVPC function', (done) => {
try {
assert.equal(true, typeof a.listHostedZonesByVPC === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing vpcid', (done) => {
try {
a.listHostedZonesByVPC(null, null, null, null, (data, error) => {
try {
const displayE = 'vpcid is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-listHostedZonesByVPCSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing vpcregion', (done) => {
try {
a.listHostedZonesByVPC('fakeparam', null, null, null, (data, error) => {
try {
const displayE = 'vpcregion is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-listHostedZonesByVPCSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#listResourceRecordSets - errors', () => {
it('should have a listResourceRecordSets function', (done) => {
try {
assert.equal(true, typeof a.listResourceRecordSets === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.listResourceRecordSets(null, null, null, null, null, null, null, null, null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-listResourceRecordSetsSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#listTagsForResources - errors', () => {
it('should have a listTagsForResources function', (done) => {
try {
assert.equal(true, typeof a.listTagsForResources === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing resourceType', (done) => {
try {
a.listTagsForResources(null, null, (data, error) => {
try {
const displayE = 'resourceType is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-listTagsForResourcesSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing body', (done) => {
try {
a.listTagsForResources('fakeparam', null, (data, error) => {
try {
const displayE = 'body is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-listTagsForResourcesSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#listTrafficPolicies - errors', () => {
it('should have a listTrafficPolicies function', (done) => {
try {
assert.equal(true, typeof a.listTrafficPolicies === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#listTrafficPolicyInstances - errors', () => {
it('should have a listTrafficPolicyInstances function', (done) => {
try {
assert.equal(true, typeof a.listTrafficPolicyInstances === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#listTrafficPolicyInstancesByHostedZone - errors', () => {
it('should have a listTrafficPolicyInstancesByHostedZone function', (done) => {
try {
assert.equal(true, typeof a.listTrafficPolicyInstancesByHostedZone === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.listTrafficPolicyInstancesByHostedZone(null, null, null, null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-listTrafficPolicyInstancesByHostedZoneSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#listTrafficPolicyInstancesByPolicy - errors', () => {
it('should have a listTrafficPolicyInstancesByPolicy function', (done) => {
try {
assert.equal(true, typeof a.listTrafficPolicyInstancesByPolicy === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.listTrafficPolicyInstancesByPolicy(null, null, null, null, null, null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-listTrafficPolicyInstancesByPolicySTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing version', (done) => {
try {
a.listTrafficPolicyInstancesByPolicy('fakeparam', null, null, null, null, null, (data, error) => {
try {
const displayE = 'version is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-listTrafficPolicyInstancesByPolicySTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#listTrafficPolicyVersions - errors', () => {
it('should have a listTrafficPolicyVersions function', (done) => {
try {
assert.equal(true, typeof a.listTrafficPolicyVersions === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing id', (done) => {
try {
a.listTrafficPolicyVersions(null, null, null, (data, error) => {
try {
const displayE = 'id is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-listTrafficPolicyVersionsSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
describe('#testDNSAnswer - errors', () => {
it('should have a testDNSAnswer function', (done) => {
try {
assert.equal(true, typeof a.testDNSAnswer === 'function');
done();
} catch (error) {
log.error(`Test Failure: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing hostedzoneid', (done) => {
try {
a.testDNSAnswer(null, null, null, null, null, null, (data, error) => {
try {
const displayE = 'hostedzoneid is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-testDNSAnswerSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing recordname', (done) => {
try {
a.testDNSAnswer('fakeparam', null, null, null, null, null, (data, error) => {
try {
const displayE = 'recordname is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-testDNSAnswerSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
it('should error if - missing recordtype', (done) => {
try {
a.testDNSAnswer('fakeparam', 'fakeparam', null, null, null, null, (data, error) => {
try {
const displayE = 'recordtype is required';
runErrorAsserts(data, error, 'AD.300', 'Test-amazon_route53-adapter-testDNSAnswerSTSRole', displayE);
done();
} catch (err) {
log.error(`Test Failure: ${err}`);
done(err);
}
});
} catch (error) {
log.error(`Adapter Exception: ${error}`);
done(error);
}
}).timeout(attemptTimeout);
});
});
});