From 1dee07a627006bee7174db66e9648d3a8d1eac29 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 9 Apr 2020 09:37:30 -0700 Subject: [PATCH] test: await assert.rejects --- .../google-cloud-securitycenter/.jsdoc.js | 2 +- .../.prettierrc.js | 2 +- .../securitycenter/v1p1beta1/asset.proto | 2 +- .../synth.metadata | 17 +++-- .../test/gapic_security_center_v1.ts | 72 +++++++++---------- .../test/gapic_security_center_v1beta1.ts | 58 +++++++-------- .../test/gapic_security_center_v1p1beta1.ts | 72 +++++++++---------- 7 files changed, 117 insertions(+), 108 deletions(-) diff --git a/packages/google-cloud-securitycenter/.jsdoc.js b/packages/google-cloud-securitycenter/.jsdoc.js index f877c24c4a8..5bf29039c8f 100644 --- a/packages/google-cloud-securitycenter/.jsdoc.js +++ b/packages/google-cloud-securitycenter/.jsdoc.js @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2019 Google, LLC.', + copyright: 'Copyright 2020 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/security-center', diff --git a/packages/google-cloud-securitycenter/.prettierrc.js b/packages/google-cloud-securitycenter/.prettierrc.js index 08cba3775be..d1b95106f4c 100644 --- a/packages/google-cloud-securitycenter/.prettierrc.js +++ b/packages/google-cloud-securitycenter/.prettierrc.js @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto index 3e4b26a8415..aaa18bcbaa9 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1p1beta1/asset.proto @@ -82,7 +82,7 @@ message Asset { // resource and cannot be modified by the user. message IamPolicy { // The JSON representation of the Policy associated with the asset. - // See https://cloud.google.com/iam/reference/rest/v1p1beta1/Policy for + // See https://cloud.google.com/iam/reference/rest/v1/Policy for // format details. string policy_blob = 1; } diff --git a/packages/google-cloud-securitycenter/synth.metadata b/packages/google-cloud-securitycenter/synth.metadata index 49bda63c82e..52aefc87725 100644 --- a/packages/google-cloud-securitycenter/synth.metadata +++ b/packages/google-cloud-securitycenter/synth.metadata @@ -1,19 +1,28 @@ { - "updateTime": "2020-04-03T12:08:21.889817Z", + "updateTime": "2020-04-09T13:34:37.897426Z", "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/nodejs-security-center.git", + "sha": "aa6257554e5b401ba7b7613f0bf78d6233ef300b" + } + }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3d5d228a58bdf875e6147b228db3159010c735ee", - "internalRef": "304500143" + "sha": "ee4ea76504aa60c2bff9b7c11269c155d8c21e0d", + "internalRef": "305619145", + "log": "ee4ea76504aa60c2bff9b7c11269c155d8c21e0d\ngapic-generator:\n- feat: Support extra plugin_args for php bazel rules rules (#3165)\n- feat: support '*' in resource definition (#3163)\n- fix: add null check and better error message when referenced resource is not found (#3169)\n\nresource name plugin:\n- support * annotation in resource def (#84)\n\nPiperOrigin-RevId: 305619145\n\ne4f4b23e07315492b533746e6a9255a1e6b3e748\nosconfig v1beta: fix the incorrect pattern for GuestPolicy resource and remove the obsolete history field.\n\nPiperOrigin-RevId: 305617619\n\nd741cd976975c745d0199987aff0e908b8352992\nchore: enable gapicv2 for firestore/v1 API\n\nNote that this contains breaking Java changes:\n com.google.cloud.firestore.v1.FirestoreClient: Method 'public void deleteDocument(com.google.firestore.v1.AnyPathName)' has been removed\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305561906\n\n0d69cddaa23b556e7299f84ad55a02ec1cad55a9\nchore: enable gapicv2 for firestore/admin/v1 API\n\nCommitter: @miraleung\n\nThere are the following breaking changes due to the collection_id discrepancy between [1] and [2]\n\n1. https://github.com/googleapis/googleapis/blob/6f8350c0df231d7e742fa10dbf929f33047715c9/google/firestore/admin/v1/firestore_gapic.yaml#L24-L29\n2. https://github.com/googleapis/googleapis/blob/6f8350c0df231d7e742fa10dbf929f33047715c9/google/firestore/admin/v1/field.proto#L39\n```\ncom.google.firestore.admin.v1.FieldName: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.FieldName: Method 'public java.lang.String getFieldId()' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public java.lang.String getFieldId()' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public com.google.firestore.admin.v1.FieldName$Builder setCollectionId(java.lang.String)' has been removed\ncom.google.firestore.admin.v1.FieldName$Builder: Method 'public com.google.firestore.admin.v1.FieldName$Builder setFieldId(java.lang.String)' has been removed\ncom.google.firestore.admin.v1.IndexName: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.IndexName: Method 'public java.lang.String getIndexId()' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public java.lang.String getCollectionId()' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public java.lang.String getIndexId()' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public com.google.firestore.admin.v1.IndexName$Builder setCollectionId(java.lang.String)' has been removed\ncom.google.firestore.admin.v1.IndexName$Builder: Method 'public com.google.firestore.admin.v1.IndexName$Builder setIndexId(java.lang.String)' has been removed\n```\n\nPiperOrigin-RevId: 305561114\n\n6f8350c0df231d7e742fa10dbf929f33047715c9\nchore: enable gapicv2 for firestore/v1beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305537104\n\nd398d687aad9eab4c6ceee9cd5e012fa61f7e28c\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 305496764\n\n5520cb891a72ab0b0cbe3facaca7b012785f5b49\nchore: update gapic-generator to cd3c9ee7\n\nChanges include:\n* update generated nox file\n* fix generated license text alignment\n\nPiperOrigin-RevId: 305484038\n\nb20965f260d70e57b7dcd312cd356d6a81f31f8e\nUpdating retry configuration settings.\n\nPiperOrigin-RevId: 305431885\n\n83d7f20c06182cb6ada9a3b47daf17b2fd22b020\nMigrate dialogflow from gapic v1 to gapic v2.\nIncluding breaking changes (resource pattern change) introduced in cl/304043500.\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 305358314\n\nf8a97692250a6c781d87528995a5c72d41ca7762\nchore: enable gapic v2 and proto annotation for Grafeas API.\n\ncommitter: @noahdietz\nPiperOrigin-RevId: 305354660\n\nb1a5ca68468eb1587168972c9d15928e98ba92b0\nEnable gapicv2 for v1/osconfig\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305351235\n\nc803327f9b1dd2583b070645b5b86e5e7ead3161\nEnable gapicv2 for osconfig/agentendpoint/v1beta\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305350472\n\n99dddf1de598f95a71d3536f5c170d84f0c0ef87\nchore: enable gapicv2 for build/v1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305349884\n\nbf85ee3ed64951c14b19ef8577689f43ee6f0f41\nchore: enable gapicv2 for cloudbuild/v1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305349873\n\nf497c7aa912df121e11772767e667fdbc10a63d9\nchore: enable gapic v2 and proto annotation for Web Security Scanner v1alpha API.\n\ncommitter: @noahdietz\nPiperOrigin-RevId: 305349342\n\n0669a37c66d76bd413343da69420bb75c49062e7\nchore: rename unused GAPIC v1 configs for IAM to legacy\n\ncommitter: @noahdietz\nPiperOrigin-RevId: 305340308\n\naf7da29c24814a1c873c22f477e9dd8dd5a17b0b\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305330079\n\n3f767aa32b4b3313027d05b503aaba63e0c432a3\ndocs: Update an out-of-date external link.\n\nPiperOrigin-RevId: 305329485\n\n9ede34d093b9d786a974448fc7a3a17948c203e2\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305327985\n\n27daba50281357b676e1ba882422ebeab4ce4f92\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 305327500\n\n82de0f6f04649651958b96fbc5b0b39dd4dbbd01\nFix: Add missing resource name definition (from the Compute API).\n\nPiperOrigin-RevId: 305324763\n\n744591190e828440f72745aef217f883afd1fd71\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 305323909\n\n1247c135ceaedfe04261d27a64aaecf78ffbae74\nchore: enable gapicv2 for videointelligence/v1beta2 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305321976\n\n633c8b13227b9e3810749964d580e5be504db488\nchore: enable gapicv2 for videointelligence/v1p1beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305320877\n\n29aac60f121dc43382b37ff92f2dbb692d94143a\ndocs: fix broken link to policy reference documentation.\n\nPiperOrigin-RevId: 305319540\n\n54ddbbf14c489b8a2f0731aa39408c016f5a8387\nbazel: update gapic-generator-go to v0.13.0\n\nChanges include:\n* add clientHook feature\n\nPiperOrigin-RevId: 305289945\n\n823facb4ca6a4b36b817ce955a790dcb40cf808f\nchore: enable gapicv2 for videointelligence/v1p3beta1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305155214\n\n6b9c969d42bcb0f8206675bd868ed7d1ddcdaef9\nAdd API for bigqueryreservation v1.\n\nPiperOrigin-RevId: 305151484\n\n514f7d27811832a9f58b83d6f6305d894b097cf6\nchore: enable gapicv2 for phishingprotection/v1beta1 API\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305126983\n\nff74d47d47280e6bbcbad1a7c82b1e0959c472ec\nfix: PHP-related fixes in BUILD.bazel and service.yamls\n\nThis PR also adds the rules for all 7 langauges in OsLogin and Kms BUILD.bazel files. Those build files were missing rules for 5 langagues, including PHP.\n\nThis PR is the prerequisite for migrating PHP synth.py scripts from artman to bazel.\n\nThe fixes in service.yaml fix regression made during proto annotation migration. This became visible only during PHP generation, because only PHP depends on the affected sections of the service.yaml config.\n\nPiperOrigin-RevId: 305108224\n\nfdbc7b1f63969307c71143a0c24fdfd02e739df6\nEnable gapicv2 for osconfig/agentendpoint/v1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305086443\n\n1490d30e1ae339570dd7826ba625a603ede91a08\nEnable gapicv2 for osconfig/v1beta\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305069755\n\n7bf824e82e5c3549642b150dc4a9579602000f34\nEnable gapicv2 for iam/credentials/v1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 305065283\n\n9ff6fd3b22f99167827e89aae7778408b5e82425\nUpdates Dataproc v1 API:\n- Adds Dataproc Jobs.SubmitJobAsOperation RPC\n- Adds SparkR and Presto job types to WorkflowTemplates\n- Adds new Optional Components\n- Clarifies usage of some APIs\n\nPiperOrigin-RevId: 305053617\n\ncad0f5137a70d0d14a8d9acbfcee98e4cd3e9662\nUpdates to Dataproc v1beta2 API:\n- Adds SparkR and Presto job types to WorkflowTemplates\n- Adds new Optional Components\n- Clarifies usage of some APIs\n\nPiperOrigin-RevId: 305053062\n\na005f045a301535eeb4c4b3fa7bb94eec9d22a8b\nAdd support for Cloud EKM to the Cloud KMS service and resource protos.\n\nPiperOrigin-RevId: 305026790\n\n5077b1e4674afdbbf11dac3f5f43d36285ba53ff\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304836531\n\nd6cb4997910eda04c0c66c0f2fd043eeaa0f660d\nchore: enable gapic v2 and proto annotation for documentai API.\n\ncommitter @summer-ji-eng\n\nPiperOrigin-RevId: 304724866\n\n490bc556608bfa5b1548c9374b06152fa33d657e\nEnable gapicv2 for devtools/remoteworkers/v1test2\n\nCommitter: @miraleung\nPiperOrigin-RevId: 304718691\n\n9f78ce31a5bd7f4a63e3cf0ddf28221557adb7ed\nEnable gapicv2 for managedidentities/v1beta1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 304718676\n\n6e17d259b8e320bc51aa240cefef05ec753e2b83\ndocs: treat a dummy example URL as a string literal instead of a link\n\nPiperOrigin-RevId: 304716376\n\na8d76f99d3073aaccabdcc122c798a63e812c4fe\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 304702368\n\n65c749bc6a1d240416a0e6979381b67f97aff907\ndocs: fix formatting of some regexes and string literals.\n\nPiperOrigin-RevId: 304701150\n\n9119eefcd2b5ce845a680fa4ec4093ed733498f0\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304698702\n\n62a2a7cc33d3535638d220df238823eefcca930d\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304696461\n\n23848c8f64a5e81a239d6133378468185f1756dc\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304696192\n\n9514fa9e390a4c0715972c5b510cf4c10ad049a1\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 304695334\n\n0f7b1509a9a452808c3d07fe90fedfcea763d7d5\nfix: change config_schema_version to 2.0.0 for containeranalysis v1 gapic config.\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 304672648\n\n3d52f3c126fbfc31f067a7f54737b7f0dfbce163\nDialogflow weekly v2 library update:\n- Change `parent` field's resource_reference to specify child_type instead of type per client library generation requirement;\n- Change Session with its child resource pattern to support both projects/{project}/agent/sessions/{session} and projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session};\n- Fix `method_signature`\n- Regular documentation update\n\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 304635286\n\n4a6a01ce0ead505c245d11a2ce156de34800c58f\ndocs: change a relative URL to an absolute URL to fix broken links.\n\nPiperOrigin-RevId: 304633630\n\n1b969c28a6579265e89cd35e6c2ecacc89970e2d\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304620317\n\n5378173a889f9c7d83e36e52d38a6267190de692\nAdd v1beta2 SubmitJobAsOperation RPC to Dataproc.\n\nPiperOrigin-RevId: 304594381\n\n" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "99820243d348191bc9c634f2b48ddf65096285ed" + "sha": "1df68ed6735ddce6797d0f83641a731c3c3f75b4", + "log": "1df68ed6735ddce6797d0f83641a731c3c3f75b4\nfix: apache license URL (#468)\n\n\nf4a59efa54808c4b958263de87bc666ce41e415f\nfeat: Add discogapic support for GAPICBazel generation (#459)\n\n* feat: Add discogapic support for GAPICBazel generation\n\n* reformat with black\n\n* Rename source repository variable\n\nCo-authored-by: Jeffrey Rennie \n" } } ], diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index 0912e01a2a1..42cdac90b37 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -331,7 +331,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createSource(request); }, expectedError); assert( @@ -445,7 +445,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createFinding(request); }, expectedError); assert( @@ -561,7 +561,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createNotificationConfig(request); }, expectedError); assert( @@ -677,7 +677,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.deleteNotificationConfig(request); }, expectedError); assert( @@ -791,7 +791,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getIamPolicy(request); }, expectedError); assert( @@ -907,7 +907,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getNotificationConfig(request); }, expectedError); assert( @@ -1023,7 +1023,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getOrganizationSettings(request); }, expectedError); assert( @@ -1134,7 +1134,7 @@ describe('v1.SecurityCenterClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getSource(request); }, expectedError); assert( @@ -1248,7 +1248,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.setFindingState(request); }, expectedError); assert( @@ -1362,7 +1362,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.setIamPolicy(request); }, expectedError); assert( @@ -1478,7 +1478,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.testIamPermissions(request); }, expectedError); assert( @@ -1595,7 +1595,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateFinding(request); }, expectedError); assert( @@ -1714,7 +1714,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateNotificationConfig(request); }, expectedError); assert( @@ -1833,7 +1833,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateOrganizationSettings(request); }, expectedError); assert( @@ -1950,7 +1950,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateSource(request); }, expectedError); assert( @@ -2069,7 +2069,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateSecurityMarks(request); }, expectedError); assert( @@ -2193,7 +2193,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.runAssetDiscovery(request); }, expectedError); assert( @@ -2228,7 +2228,7 @@ describe('v1.SecurityCenterClient', () => { expectedError ); const [operation] = await client.runAssetDiscovery(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -2358,7 +2358,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.groupAssets(request); }, expectedError); assert( @@ -2456,7 +2456,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -2534,7 +2534,7 @@ describe('v1.SecurityCenterClient', () => { expectedError ); const iterable = client.groupAssetsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2674,7 +2674,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.groupFindings(request); }, expectedError); assert( @@ -2773,7 +2773,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -2852,7 +2852,7 @@ describe('v1.SecurityCenterClient', () => { expectedError ); const iterable = client.groupFindingsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1.IGroupResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2994,7 +2994,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listAssets(request); }, expectedError); assert( @@ -3096,7 +3096,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -3174,7 +3174,7 @@ describe('v1.SecurityCenterClient', () => { expectedError ); const iterable = client.listAssetsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1.ListAssetsResponse.IListAssetsResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3316,7 +3316,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listFindings(request); }, expectedError); assert( @@ -3419,7 +3419,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -3498,7 +3498,7 @@ describe('v1.SecurityCenterClient', () => { expectedError ); const iterable = client.listFindingsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1.ListFindingsResponse.IListFindingsResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3642,7 +3642,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listNotificationConfigs(request); }, expectedError); assert( @@ -3746,7 +3746,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -3826,7 +3826,7 @@ describe('v1.SecurityCenterClient', () => { expectedError ); const iterable = client.listNotificationConfigsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1.INotificationConfig[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3966,7 +3966,7 @@ describe('v1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listSources(request); }, expectedError); assert( @@ -4064,7 +4064,7 @@ describe('v1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -4142,7 +4142,7 @@ describe('v1.SecurityCenterClient', () => { expectedError ); const iterable = client.listSourcesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1.ISource[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts index 4187ac96644..40c1cb9ed40 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1beta1.ts @@ -331,7 +331,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createSource(request); }, expectedError); assert( @@ -445,7 +445,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createFinding(request); }, expectedError); assert( @@ -559,7 +559,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getIamPolicy(request); }, expectedError); assert( @@ -675,7 +675,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getOrganizationSettings(request); }, expectedError); assert( @@ -786,7 +786,7 @@ describe('v1beta1.SecurityCenterClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getSource(request); }, expectedError); assert( @@ -900,7 +900,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.setFindingState(request); }, expectedError); assert( @@ -1014,7 +1014,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.setIamPolicy(request); }, expectedError); assert( @@ -1130,7 +1130,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.testIamPermissions(request); }, expectedError); assert( @@ -1247,7 +1247,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateFinding(request); }, expectedError); assert( @@ -1366,7 +1366,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateOrganizationSettings(request); }, expectedError); assert( @@ -1483,7 +1483,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateSource(request); }, expectedError); assert( @@ -1602,7 +1602,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateSecurityMarks(request); }, expectedError); assert( @@ -1726,7 +1726,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.runAssetDiscovery(request); }, expectedError); assert( @@ -1761,7 +1761,7 @@ describe('v1beta1.SecurityCenterClient', () => { expectedError ); const [operation] = await client.runAssetDiscovery(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -1893,7 +1893,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.groupAssets(request); }, expectedError); assert( @@ -1995,7 +1995,7 @@ describe('v1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -2073,7 +2073,7 @@ describe('v1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.groupAssetsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2215,7 +2215,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.groupFindings(request); }, expectedError); assert( @@ -2318,7 +2318,7 @@ describe('v1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -2397,7 +2397,7 @@ describe('v1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.groupFindingsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1beta1.IGroupResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2539,7 +2539,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listAssets(request); }, expectedError); assert( @@ -2641,7 +2641,7 @@ describe('v1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -2719,7 +2719,7 @@ describe('v1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.listAssetsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2861,7 +2861,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listFindings(request); }, expectedError); assert( @@ -2960,7 +2960,7 @@ describe('v1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -3039,7 +3039,7 @@ describe('v1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.listFindingsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1beta1.IFinding[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3179,7 +3179,7 @@ describe('v1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listSources(request); }, expectedError); assert( @@ -3277,7 +3277,7 @@ describe('v1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -3355,7 +3355,7 @@ describe('v1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.listSourcesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1beta1.ISource[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts index 4e9fe1cc44c..43fd674dfbb 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1p1beta1.ts @@ -331,7 +331,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createSource(request); }, expectedError); assert( @@ -445,7 +445,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createFinding(request); }, expectedError); assert( @@ -561,7 +561,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createNotificationConfig(request); }, expectedError); assert( @@ -677,7 +677,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.deleteNotificationConfig(request); }, expectedError); assert( @@ -791,7 +791,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getIamPolicy(request); }, expectedError); assert( @@ -907,7 +907,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getNotificationConfig(request); }, expectedError); assert( @@ -1023,7 +1023,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getOrganizationSettings(request); }, expectedError); assert( @@ -1134,7 +1134,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getSource(request); }, expectedError); assert( @@ -1248,7 +1248,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.setFindingState(request); }, expectedError); assert( @@ -1362,7 +1362,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.setIamPolicy(request); }, expectedError); assert( @@ -1478,7 +1478,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.testIamPermissions(request); }, expectedError); assert( @@ -1595,7 +1595,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateFinding(request); }, expectedError); assert( @@ -1714,7 +1714,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateNotificationConfig(request); }, expectedError); assert( @@ -1833,7 +1833,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateOrganizationSettings(request); }, expectedError); assert( @@ -1950,7 +1950,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateSource(request); }, expectedError); assert( @@ -2069,7 +2069,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateSecurityMarks(request); }, expectedError); assert( @@ -2193,7 +2193,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.runAssetDiscovery(request); }, expectedError); assert( @@ -2228,7 +2228,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { expectedError ); const [operation] = await client.runAssetDiscovery(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -2360,7 +2360,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.groupAssets(request); }, expectedError); assert( @@ -2462,7 +2462,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -2540,7 +2540,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.groupAssetsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2682,7 +2682,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.groupFindings(request); }, expectedError); assert( @@ -2785,7 +2785,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -2864,7 +2864,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.groupFindingsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1p1beta1.IGroupResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3006,7 +3006,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listAssets(request); }, expectedError); assert( @@ -3108,7 +3108,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -3186,7 +3186,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.listAssetsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1p1beta1.ListAssetsResponse.IListAssetsResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3328,7 +3328,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listFindings(request); }, expectedError); assert( @@ -3431,7 +3431,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -3510,7 +3510,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.listFindingsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1p1beta1.ListFindingsResponse.IListFindingsResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3654,7 +3654,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listNotificationConfigs(request); }, expectedError); assert( @@ -3758,7 +3758,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -3838,7 +3838,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.listNotificationConfigsAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1p1beta1.INotificationConfig[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3980,7 +3980,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listSources(request); }, expectedError); assert( @@ -4078,7 +4078,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -4156,7 +4156,7 @@ describe('v1p1beta1.SecurityCenterClient', () => { expectedError ); const iterable = client.listSourcesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.securitycenter.v1p1beta1.ISource[] = []; for await (const resource of iterable) { responses.push(resource!);