Skip to content

Commit

Permalink
feat(IAM Policy Management): re-generated the code with sdk 3.41 to f…
Browse files Browse the repository at this point in the history
…ix unit testcases
  • Loading branch information
Rajesh-Pirati committed Oct 19, 2021
1 parent 9a52fce commit 33a04f3
Showing 1 changed file with 90 additions and 80 deletions.
170 changes: 90 additions & 80 deletions test/unit/iam-policy-management.v1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ describe('IamPolicyManagementV1', () => {
});

describe('negative tests', () => {
test('should enforce required parameters', async (done) => {
test('should enforce required parameters', async () => {
let err;
try {
await iamPolicyManagementService.listPolicies({});
Expand All @@ -201,14 +201,15 @@ describe('IamPolicyManagementV1', () => {
expect(err.message).toMatch(/Missing required parameters/);
});

test('should reject promise when required params are not given', (done) => {
const listPoliciesPromise = iamPolicyManagementService.listPolicies();
expectToBePromise(listPoliciesPromise);
test('should reject promise when required params are not given', async () => {
let err;
try {
await iamPolicyManagementService.listPolicies();
} catch (e) {
err = e;
}

listPoliciesPromise.catch((err) => {
expect(err.message).toMatch(/Missing required parameters/);
done();
});
expect(err.message).toMatch(/Missing required parameters/);
});
});
});
Expand Down Expand Up @@ -331,7 +332,7 @@ describe('IamPolicyManagementV1', () => {
});

describe('negative tests', () => {
test('should enforce required parameters', async (done) => {
test('should enforce required parameters', async () => {
let err;
try {
await iamPolicyManagementService.createPolicy({});
Expand All @@ -342,14 +343,15 @@ describe('IamPolicyManagementV1', () => {
expect(err.message).toMatch(/Missing required parameters/);
});

test('should reject promise when required params are not given', (done) => {
const createPolicyPromise = iamPolicyManagementService.createPolicy();
expectToBePromise(createPolicyPromise);
test('should reject promise when required params are not given', async () => {
let err;
try {
await iamPolicyManagementService.createPolicy();
} catch (e) {
err = e;
}

createPolicyPromise.catch((err) => {
expect(err.message).toMatch(/Missing required parameters/);
done();
});
expect(err.message).toMatch(/Missing required parameters/);
});
});
});
Expand Down Expand Up @@ -479,7 +481,7 @@ describe('IamPolicyManagementV1', () => {
});

describe('negative tests', () => {
test('should enforce required parameters', async (done) => {
test('should enforce required parameters', async () => {
let err;
try {
await iamPolicyManagementService.updatePolicy({});
Expand All @@ -490,14 +492,15 @@ describe('IamPolicyManagementV1', () => {
expect(err.message).toMatch(/Missing required parameters/);
});

test('should reject promise when required params are not given', (done) => {
const updatePolicyPromise = iamPolicyManagementService.updatePolicy();
expectToBePromise(updatePolicyPromise);
test('should reject promise when required params are not given', async () => {
let err;
try {
await iamPolicyManagementService.updatePolicy();
} catch (e) {
err = e;
}

updatePolicyPromise.catch((err) => {
expect(err.message).toMatch(/Missing required parameters/);
done();
});
expect(err.message).toMatch(/Missing required parameters/);
});
});
});
Expand Down Expand Up @@ -561,7 +564,7 @@ describe('IamPolicyManagementV1', () => {
});

describe('negative tests', () => {
test('should enforce required parameters', async (done) => {
test('should enforce required parameters', async () => {
let err;
try {
await iamPolicyManagementService.getPolicy({});
Expand All @@ -572,14 +575,15 @@ describe('IamPolicyManagementV1', () => {
expect(err.message).toMatch(/Missing required parameters/);
});

test('should reject promise when required params are not given', (done) => {
const getPolicyPromise = iamPolicyManagementService.getPolicy();
expectToBePromise(getPolicyPromise);
test('should reject promise when required params are not given', async () => {
let err;
try {
await iamPolicyManagementService.getPolicy();
} catch (e) {
err = e;
}

getPolicyPromise.catch((err) => {
expect(err.message).toMatch(/Missing required parameters/);
done();
});
expect(err.message).toMatch(/Missing required parameters/);
});
});
});
Expand Down Expand Up @@ -643,7 +647,7 @@ describe('IamPolicyManagementV1', () => {
});

describe('negative tests', () => {
test('should enforce required parameters', async (done) => {
test('should enforce required parameters', async () => {
let err;
try {
await iamPolicyManagementService.deletePolicy({});
Expand All @@ -654,14 +658,15 @@ describe('IamPolicyManagementV1', () => {
expect(err.message).toMatch(/Missing required parameters/);
});

test('should reject promise when required params are not given', (done) => {
const deletePolicyPromise = iamPolicyManagementService.deletePolicy();
expectToBePromise(deletePolicyPromise);
test('should reject promise when required params are not given', async () => {
let err;
try {
await iamPolicyManagementService.deletePolicy();
} catch (e) {
err = e;
}

deletePolicyPromise.catch((err) => {
expect(err.message).toMatch(/Missing required parameters/);
done();
});
expect(err.message).toMatch(/Missing required parameters/);
});
});
});
Expand Down Expand Up @@ -733,7 +738,7 @@ describe('IamPolicyManagementV1', () => {
});

describe('negative tests', () => {
test('should enforce required parameters', async (done) => {
test('should enforce required parameters', async () => {
let err;
try {
await iamPolicyManagementService.patchPolicy({});
Expand All @@ -744,14 +749,15 @@ describe('IamPolicyManagementV1', () => {
expect(err.message).toMatch(/Missing required parameters/);
});

test('should reject promise when required params are not given', (done) => {
const patchPolicyPromise = iamPolicyManagementService.patchPolicy();
expectToBePromise(patchPolicyPromise);
test('should reject promise when required params are not given', async () => {
let err;
try {
await iamPolicyManagementService.patchPolicy();
} catch (e) {
err = e;
}

patchPolicyPromise.catch((err) => {
expect(err.message).toMatch(/Missing required parameters/);
done();
});
expect(err.message).toMatch(/Missing required parameters/);
});
});
});
Expand Down Expand Up @@ -916,7 +922,7 @@ describe('IamPolicyManagementV1', () => {
});

describe('negative tests', () => {
test('should enforce required parameters', async (done) => {
test('should enforce required parameters', async () => {
let err;
try {
await iamPolicyManagementService.createRole({});
Expand All @@ -927,14 +933,15 @@ describe('IamPolicyManagementV1', () => {
expect(err.message).toMatch(/Missing required parameters/);
});

test('should reject promise when required params are not given', (done) => {
const createRolePromise = iamPolicyManagementService.createRole();
expectToBePromise(createRolePromise);
test('should reject promise when required params are not given', async () => {
let err;
try {
await iamPolicyManagementService.createRole();
} catch (e) {
err = e;
}

createRolePromise.catch((err) => {
expect(err.message).toMatch(/Missing required parameters/);
done();
});
expect(err.message).toMatch(/Missing required parameters/);
});
});
});
Expand Down Expand Up @@ -1012,7 +1019,7 @@ describe('IamPolicyManagementV1', () => {
});

describe('negative tests', () => {
test('should enforce required parameters', async (done) => {
test('should enforce required parameters', async () => {
let err;
try {
await iamPolicyManagementService.updateRole({});
Expand All @@ -1023,14 +1030,15 @@ describe('IamPolicyManagementV1', () => {
expect(err.message).toMatch(/Missing required parameters/);
});

test('should reject promise when required params are not given', (done) => {
const updateRolePromise = iamPolicyManagementService.updateRole();
expectToBePromise(updateRolePromise);
test('should reject promise when required params are not given', async () => {
let err;
try {
await iamPolicyManagementService.updateRole();
} catch (e) {
err = e;
}

updateRolePromise.catch((err) => {
expect(err.message).toMatch(/Missing required parameters/);
done();
});
expect(err.message).toMatch(/Missing required parameters/);
});
});
});
Expand Down Expand Up @@ -1094,7 +1102,7 @@ describe('IamPolicyManagementV1', () => {
});

describe('negative tests', () => {
test('should enforce required parameters', async (done) => {
test('should enforce required parameters', async () => {
let err;
try {
await iamPolicyManagementService.getRole({});
Expand All @@ -1105,14 +1113,15 @@ describe('IamPolicyManagementV1', () => {
expect(err.message).toMatch(/Missing required parameters/);
});

test('should reject promise when required params are not given', (done) => {
const getRolePromise = iamPolicyManagementService.getRole();
expectToBePromise(getRolePromise);
test('should reject promise when required params are not given', async () => {
let err;
try {
await iamPolicyManagementService.getRole();
} catch (e) {
err = e;
}

getRolePromise.catch((err) => {
expect(err.message).toMatch(/Missing required parameters/);
done();
});
expect(err.message).toMatch(/Missing required parameters/);
});
});
});
Expand Down Expand Up @@ -1176,7 +1185,7 @@ describe('IamPolicyManagementV1', () => {
});

describe('negative tests', () => {
test('should enforce required parameters', async (done) => {
test('should enforce required parameters', async () => {
let err;
try {
await iamPolicyManagementService.deleteRole({});
Expand All @@ -1187,14 +1196,15 @@ describe('IamPolicyManagementV1', () => {
expect(err.message).toMatch(/Missing required parameters/);
});

test('should reject promise when required params are not given', (done) => {
const deleteRolePromise = iamPolicyManagementService.deleteRole();
expectToBePromise(deleteRolePromise);
test('should reject promise when required params are not given', async () => {
let err;
try {
await iamPolicyManagementService.deleteRole();
} catch (e) {
err = e;
}

deleteRolePromise.catch((err) => {
expect(err.message).toMatch(/Missing required parameters/);
done();
});
expect(err.message).toMatch(/Missing required parameters/);
});
});
});
Expand Down

0 comments on commit 33a04f3

Please sign in to comment.