Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
feat: Added vulnerability field to the finding feat: Added type field…
Browse files Browse the repository at this point in the history
… to the resource which is surfaced in NotificationMessage (#676)

* feat: Added vulnerability field to the finding feat: Added type field to the resource which is surfaced in NotificationMessage

PiperOrigin-RevId: 401787368

Source-Link: googleapis/googleapis@a7a3440

Source-Link: googleapis/googleapis-gen@169ba7f
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTY5YmE3ZmViZjAwZWUwMzA0NDZhMDUzNGFjNzdhZDU3ZjBiZjgzYSJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Oct 8, 2021
1 parent 7f95908 commit 2240296
Show file tree
Hide file tree
Showing 19 changed files with 7,530 additions and 56 deletions.
Expand Up @@ -208,6 +208,7 @@ public void createFindingTest() throws Exception {
.setCreateTime(Timestamp.newBuilder().build())
.setCanonicalName("canonicalName2122381727")
.setIndicator(Indicator.newBuilder().build())
.setVulnerability(Vulnerability.newBuilder().build())
.build();
mockSecurityCenter.addResponse(expectedResponse);

Expand Down Expand Up @@ -265,6 +266,7 @@ public void createFindingTest2() throws Exception {
.setCreateTime(Timestamp.newBuilder().build())
.setCanonicalName("canonicalName2122381727")
.setIndicator(Indicator.newBuilder().build())
.setVulnerability(Vulnerability.newBuilder().build())
.build();
mockSecurityCenter.addResponse(expectedResponse);

Expand Down Expand Up @@ -578,7 +580,7 @@ public void getIamPolicyTest() throws Exception {
.build();
mockSecurityCenter.addResponse(expectedResponse);

ResourceName resource = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]");
ResourceName resource = ProjectName.of("[PROJECT]");

Policy actualResponse = client.getIamPolicy(resource);
Assert.assertEquals(expectedResponse, actualResponse);
Expand All @@ -600,7 +602,7 @@ public void getIamPolicyExceptionTest() throws Exception {
mockSecurityCenter.addException(exception);

try {
ResourceName resource = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]");
ResourceName resource = ProjectName.of("[PROJECT]");
client.getIamPolicy(resource);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
Expand Down Expand Up @@ -1581,6 +1583,7 @@ public void setFindingStateTest() throws Exception {
.setCreateTime(Timestamp.newBuilder().build())
.setCanonicalName("canonicalName2122381727")
.setIndicator(Indicator.newBuilder().build())
.setVulnerability(Vulnerability.newBuilder().build())
.build();
mockSecurityCenter.addResponse(expectedResponse);

Expand Down Expand Up @@ -1640,6 +1643,7 @@ public void setFindingStateTest2() throws Exception {
.setCreateTime(Timestamp.newBuilder().build())
.setCanonicalName("canonicalName2122381727")
.setIndicator(Indicator.newBuilder().build())
.setVulnerability(Vulnerability.newBuilder().build())
.build();
mockSecurityCenter.addResponse(expectedResponse);

Expand Down Expand Up @@ -1689,7 +1693,7 @@ public void setIamPolicyTest() throws Exception {
.build();
mockSecurityCenter.addResponse(expectedResponse);

ResourceName resource = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]");
ResourceName resource = ProjectName.of("[PROJECT]");
Policy policy = Policy.newBuilder().build();

Policy actualResponse = client.setIamPolicy(resource, policy);
Expand All @@ -1713,7 +1717,7 @@ public void setIamPolicyExceptionTest() throws Exception {
mockSecurityCenter.addException(exception);

try {
ResourceName resource = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]");
ResourceName resource = ProjectName.of("[PROJECT]");
Policy policy = Policy.newBuilder().build();
client.setIamPolicy(resource, policy);
Assert.fail("No exception raised");
Expand Down Expand Up @@ -1771,7 +1775,7 @@ public void testIamPermissionsTest() throws Exception {
TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList<String>()).build();
mockSecurityCenter.addResponse(expectedResponse);

ResourceName resource = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]");
ResourceName resource = ProjectName.of("[PROJECT]");
List<String> permissions = new ArrayList<>();

TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions);
Expand All @@ -1795,7 +1799,7 @@ public void testIamPermissionsExceptionTest() throws Exception {
mockSecurityCenter.addException(exception);

try {
ResourceName resource = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]");
ResourceName resource = ProjectName.of("[PROJECT]");
List<String> permissions = new ArrayList<>();
client.testIamPermissions(resource, permissions);
Assert.fail("No exception raised");
Expand Down Expand Up @@ -1861,6 +1865,7 @@ public void updateFindingTest() throws Exception {
.setCreateTime(Timestamp.newBuilder().build())
.setCanonicalName("canonicalName2122381727")
.setIndicator(Indicator.newBuilder().build())
.setVulnerability(Vulnerability.newBuilder().build())
.build();
mockSecurityCenter.addResponse(expectedResponse);

Expand Down

0 comments on commit 2240296

Please sign in to comment.