@@ -550,6 +550,33 @@ TEST(GrpcObjectRequestParser, PredefinedAclObject) {
550550 GrpcObjectRequestParser::ToProtoObject (PredefinedAcl::BucketOwnerRead ()));
551551}
552552
553+ TEST (GrpcObjectRequestParser, GetObjectMetadataAllFields) {
554+ google::storage::v2::GetObjectRequest expected;
555+ EXPECT_TRUE (google::protobuf::TextFormat::ParseFromString (
556+ R"pb(
557+ bucket: "projects/_/buckets/test-bucket"
558+ object: "test-object"
559+ generation: 7
560+ if_generation_match: 1
561+ if_generation_not_match: 2
562+ if_metageneration_match: 3
563+ if_metageneration_not_match: 4
564+ common_request_params: { user_project: "test-user-project" }
565+ read_mask { paths: "*" }
566+ )pb" ,
567+ &expected));
568+
569+ GetObjectMetadataRequest req (" test-bucket" , " test-object" );
570+ req.set_multiple_options (
571+ Generation (7 ), IfGenerationMatch (1 ), IfGenerationNotMatch (2 ),
572+ IfMetagenerationMatch (3 ), IfMetagenerationNotMatch (4 ), Projection (" full" ),
573+ UserProject (" test-user-project" ), UserProject (" test-user-project" ),
574+ QuotaUser (" test-quota-user" ), UserIp (" test-user-ip" ));
575+
576+ auto const actual = GrpcObjectRequestParser::ToProto (req);
577+ EXPECT_THAT (actual, IsProtoEqual (expected));
578+ }
579+
553580} // namespace
554581} // namespace internal
555582GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
0 commit comments