Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,12 @@ public static List<Service> parseService(
public static Map<String, Message> parseMessages(CodeGeneratorRequest request) {
Map<String, FileDescriptor> fileDescriptors = getFilesToGenerate(request);
Map<String, Message> messages = new HashMap<>();
for (String fileToGenerate : request.getFileToGenerateList()) {
FileDescriptor fileDescriptor =
Preconditions.checkNotNull(
fileDescriptors.get(fileToGenerate),
"Missing file descriptor for [%s]",
fileToGenerate);
// Look for message types amongst all the protos, not just the ones to generate. This will
// ensure we track commonly-used protos like Empty.
for (FileDescriptor fileDescriptor : fileDescriptors.values()) {
messages.putAll(parseMessages(fileDescriptor));
}

return messages;
}

Expand Down
1 change: 1 addition & 0 deletions test/integration/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ java_gapic_library(
"@com_google_googleapis//google/cloud/asset/v1:asset_java_proto",
"@com_google_googleapis//google/iam/v1:iam_java_proto",
"@com_google_googleapis//google/identity/accesscontextmanager/v1:accesscontextmanager_proto",
"@com_google_googleapis//google/type:type_java_proto",
],
)

Expand Down
9 changes: 9 additions & 0 deletions test/integration/goldens/asset/AssetServiceClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import com.google.protobuf.AbstractMessage;
import com.google.protobuf.Any;
import com.google.protobuf.Empty;
import com.google.protobuf.Timestamp;
import com.google.type.Expr;
import io.grpc.StatusRuntimeException;
import java.io.IOException;
import java.util.ArrayList;
Expand Down Expand Up @@ -89,6 +91,7 @@ public void tearDown() throws Exception {
public void exportAssetsTest() throws Exception {
ExportAssetsResponse expectedResponse =
ExportAssetsResponse.newBuilder()
.setReadTime(Timestamp.newBuilder().build())
.setOutputConfig(OutputConfig.newBuilder().build())
.setOutputResult(OutputResult.newBuilder().build())
.build();
Expand All @@ -103,6 +106,7 @@ public void exportAssetsTest() throws Exception {
ExportAssetsRequest request =
ExportAssetsRequest.newBuilder()
.setParent(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString())
.setReadTime(Timestamp.newBuilder().build())
.addAllAssetTypes(new ArrayList<String>())
.setOutputConfig(OutputConfig.newBuilder().build())
.build();
Expand Down Expand Up @@ -134,6 +138,7 @@ public void exportAssetsExceptionTest() throws Exception {
ExportAssetsRequest request =
ExportAssetsRequest.newBuilder()
.setParent(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString())
.setReadTime(Timestamp.newBuilder().build())
.addAllAssetTypes(new ArrayList<String>())
.setOutputConfig(OutputConfig.newBuilder().build())
.build();
Expand Down Expand Up @@ -206,6 +211,7 @@ public void createFeedTest() throws Exception {
.addAllAssetNames(new ArrayList<String>())
.addAllAssetTypes(new ArrayList<String>())
.setFeedOutputConfig(FeedOutputConfig.newBuilder().build())
.setCondition(Expr.newBuilder().build())
.build();
mockAssetService.addResponse(expectedResponse);

Expand Down Expand Up @@ -247,6 +253,7 @@ public void getFeedTest() throws Exception {
.addAllAssetNames(new ArrayList<String>())
.addAllAssetTypes(new ArrayList<String>())
.setFeedOutputConfig(FeedOutputConfig.newBuilder().build())
.setCondition(Expr.newBuilder().build())
.build();
mockAssetService.addResponse(expectedResponse);

Expand Down Expand Up @@ -288,6 +295,7 @@ public void getFeedTest2() throws Exception {
.addAllAssetNames(new ArrayList<String>())
.addAllAssetTypes(new ArrayList<String>())
.setFeedOutputConfig(FeedOutputConfig.newBuilder().build())
.setCondition(Expr.newBuilder().build())
.build();
mockAssetService.addResponse(expectedResponse);

Expand Down Expand Up @@ -365,6 +373,7 @@ public void updateFeedTest() throws Exception {
.addAllAssetNames(new ArrayList<String>())
.addAllAssetTypes(new ArrayList<String>())
.setFeedOutputConfig(FeedOutputConfig.newBuilder().build())
.setCondition(Expr.newBuilder().build())
.build();
mockAssetService.addResponse(expectedResponse);

Expand Down
49 changes: 49 additions & 0 deletions test/integration/goldens/logging/ConfigServiceV2ClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.google.protobuf.AbstractMessage;
import com.google.protobuf.Empty;
import com.google.protobuf.FieldMask;
import com.google.protobuf.Timestamp;
import io.grpc.StatusRuntimeException;
import java.io.IOException;
import java.util.Arrays;
Expand Down Expand Up @@ -312,6 +313,8 @@ public void getBucketTest() throws Exception {
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.setDescription("description-1724546052")
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.setRetentionDays(1544391896)
.build();
mockConfigServiceV2.addResponse(expectedResponse);
Expand Down Expand Up @@ -364,6 +367,8 @@ public void updateBucketTest() throws Exception {
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.setDescription("description-1724546052")
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.setRetentionDays(1544391896)
.build();
mockConfigServiceV2.addResponse(expectedResponse);
Expand All @@ -374,6 +379,7 @@ public void updateBucketTest() throws Exception {
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.setBucket(LogBucket.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();

LogBucket actualResponse = client.updateBucket(request);
Expand Down Expand Up @@ -404,6 +410,7 @@ public void updateBucketExceptionTest() throws Exception {
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.setBucket(LogBucket.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
client.updateBucket(request);
Assert.fail("No exception raised");
Expand Down Expand Up @@ -643,6 +650,8 @@ public void getSinkTest() throws Exception {
.setDisabled(true)
.setWriterIdentity("writer_identity775638794")
.setIncludeChildren(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -687,6 +696,8 @@ public void getSinkTest2() throws Exception {
.setDisabled(true)
.setWriterIdentity("writer_identity775638794")
.setIncludeChildren(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -731,6 +742,8 @@ public void createSinkTest() throws Exception {
.setDisabled(true)
.setWriterIdentity("writer_identity775638794")
.setIncludeChildren(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -778,6 +791,8 @@ public void createSinkTest2() throws Exception {
.setDisabled(true)
.setWriterIdentity("writer_identity775638794")
.setIncludeChildren(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -825,6 +840,8 @@ public void createSinkTest3() throws Exception {
.setDisabled(true)
.setWriterIdentity("writer_identity775638794")
.setIncludeChildren(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -872,6 +889,8 @@ public void createSinkTest4() throws Exception {
.setDisabled(true)
.setWriterIdentity("writer_identity775638794")
.setIncludeChildren(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -919,6 +938,8 @@ public void createSinkTest5() throws Exception {
.setDisabled(true)
.setWriterIdentity("writer_identity775638794")
.setIncludeChildren(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -966,6 +987,8 @@ public void updateSinkTest() throws Exception {
.setDisabled(true)
.setWriterIdentity("writer_identity775638794")
.setIncludeChildren(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -1013,6 +1036,8 @@ public void updateSinkTest2() throws Exception {
.setDisabled(true)
.setWriterIdentity("writer_identity775638794")
.setIncludeChildren(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -1060,6 +1085,8 @@ public void updateSinkTest3() throws Exception {
.setDisabled(true)
.setWriterIdentity("writer_identity775638794")
.setIncludeChildren(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -1110,6 +1137,8 @@ public void updateSinkTest4() throws Exception {
.setDisabled(true)
.setWriterIdentity("writer_identity775638794")
.setIncludeChildren(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -1447,6 +1476,8 @@ public void getExclusionTest() throws Exception {
.setDescription("description-1724546052")
.setFilter("filter-1274492040")
.setDisabled(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -1488,6 +1519,8 @@ public void getExclusionTest2() throws Exception {
.setDescription("description-1724546052")
.setFilter("filter-1274492040")
.setDisabled(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -1529,6 +1562,8 @@ public void createExclusionTest() throws Exception {
.setDescription("description-1724546052")
.setFilter("filter-1274492040")
.setDisabled(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -1573,6 +1608,8 @@ public void createExclusionTest2() throws Exception {
.setDescription("description-1724546052")
.setFilter("filter-1274492040")
.setDisabled(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -1617,6 +1654,8 @@ public void createExclusionTest3() throws Exception {
.setDescription("description-1724546052")
.setFilter("filter-1274492040")
.setDisabled(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -1661,6 +1700,8 @@ public void createExclusionTest4() throws Exception {
.setDescription("description-1724546052")
.setFilter("filter-1274492040")
.setDisabled(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -1705,6 +1746,8 @@ public void createExclusionTest5() throws Exception {
.setDescription("description-1724546052")
.setFilter("filter-1274492040")
.setDisabled(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -1749,6 +1792,8 @@ public void updateExclusionTest() throws Exception {
.setDescription("description-1724546052")
.setFilter("filter-1274492040")
.setDisabled(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -1796,6 +1841,8 @@ public void updateExclusionTest2() throws Exception {
.setDescription("description-1724546052")
.setFilter("filter-1274492040")
.setDisabled(true)
.setCreateTime(Timestamp.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.build();
mockConfigServiceV2.addResponse(expectedResponse);

Expand Down Expand Up @@ -1965,6 +2012,7 @@ public void updateCmekSettingsTest() throws Exception {
UpdateCmekSettingsRequest.newBuilder()
.setName("name3373707")
.setCmekSettings(CmekSettings.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();

CmekSettings actualResponse = client.updateCmekSettings(request);
Expand Down Expand Up @@ -1993,6 +2041,7 @@ public void updateCmekSettingsExceptionTest() throws Exception {
UpdateCmekSettingsRequest.newBuilder()
.setName("name3373707")
.setCmekSettings(CmekSettings.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
client.updateCmekSettings(request);
Assert.fail("No exception raised");
Expand Down
Loading