@@ -300,12 +300,21 @@ TEST(BigtableStubFactory, FeaturesFlagsCloudDirectPath) {
300300 auto headers = fixture.GetMetadata (context);
301301 auto it = headers.find (" bigtable-features" );
302302 EXPECT_NE (it, headers.end ());
303+ if (it == headers.end ())
304+ return internal::AbortedError (" header not found" );
303305 auto decoded = internal::UrlsafeBase64Decode (it->second );
304306 EXPECT_STATUS_OK (decoded);
305307 if (!decoded) return internal::AbortedError (" fail to decode" );
306308 google::bigtable::v2::FeatureFlags proto;
307309 EXPECT_TRUE (proto.ParseFromArray (
308310 decoded->data (), static_cast <int >(decoded->size ())));
311+ EXPECT_TRUE (proto.reverse_scans ());
312+ EXPECT_TRUE (proto.last_scanned_row_responses ());
313+ EXPECT_TRUE (proto.mutate_rows_rate_limit ());
314+ EXPECT_TRUE (proto.mutate_rows_rate_limit2 ());
315+ EXPECT_TRUE (proto.routing_cookie ());
316+ EXPECT_TRUE (proto.retry_info ());
317+ EXPECT_TRUE (proto.peer_info ());
309318 EXPECT_TRUE (proto.traffic_director_enabled ());
310319 EXPECT_TRUE (proto.direct_access_requested ());
311320 return internal::AbortedError (" fail" );
@@ -341,11 +350,20 @@ TEST(BigtableStubFactory, FeaturesFlagsBigtableDirectPath) {
341350 auto it = headers.find (" bigtable-features" );
342351 EXPECT_NE (it, headers.end ());
343352 auto decoded = internal::UrlsafeBase64Decode (it->second );
353+ if (it == headers.end ())
354+ return internal::AbortedError (" header not found" );
344355 EXPECT_STATUS_OK (decoded);
345356 if (!decoded) return internal::AbortedError (" fail to decode" );
346357 google::bigtable::v2::FeatureFlags proto;
347358 EXPECT_TRUE (proto.ParseFromArray (
348359 decoded->data (), static_cast <int >(decoded->size ())));
360+ EXPECT_TRUE (proto.reverse_scans ());
361+ EXPECT_TRUE (proto.last_scanned_row_responses ());
362+ EXPECT_TRUE (proto.mutate_rows_rate_limit ());
363+ EXPECT_TRUE (proto.mutate_rows_rate_limit2 ());
364+ EXPECT_TRUE (proto.routing_cookie ());
365+ EXPECT_TRUE (proto.retry_info ());
366+ EXPECT_TRUE (proto.peer_info ());
349367 EXPECT_TRUE (proto.traffic_director_enabled ());
350368 EXPECT_TRUE (proto.direct_access_requested ());
351369 return internal::AbortedError (" fail" );
@@ -378,10 +396,25 @@ TEST(BigtableStubFactory, FeaturesFlags) {
378396 google::bigtable::v2::MutateRowRequest const &) {
379397 ValidateMetadataFixture fixture;
380398 auto headers = fixture.GetMetadata (context);
381- EXPECT_THAT (
382- headers,
383- Contains (Pair (" bigtable-features" ,
384- AllOf (Not (IsEmpty ()), IsWebSafeBase64 ()))));
399+ auto it = headers.find (" bigtable-features" );
400+ EXPECT_NE (it, headers.end ());
401+ if (it == headers.end ())
402+ return internal::AbortedError (" header not found" );
403+ auto decoded = internal::UrlsafeBase64Decode (it->second );
404+ EXPECT_STATUS_OK (decoded);
405+ if (!decoded) return internal::AbortedError (" fail to decode" );
406+ google::bigtable::v2::FeatureFlags proto;
407+ EXPECT_TRUE (proto.ParseFromArray (
408+ decoded->data (), static_cast <int >(decoded->size ())));
409+ EXPECT_TRUE (proto.reverse_scans ());
410+ EXPECT_TRUE (proto.last_scanned_row_responses ());
411+ EXPECT_TRUE (proto.mutate_rows_rate_limit ());
412+ EXPECT_TRUE (proto.mutate_rows_rate_limit2 ());
413+ EXPECT_TRUE (proto.routing_cookie ());
414+ EXPECT_TRUE (proto.retry_info ());
415+ EXPECT_TRUE (proto.peer_info ());
416+ EXPECT_FALSE (proto.traffic_director_enabled ());
417+ EXPECT_FALSE (proto.direct_access_requested ());
385418 return internal::AbortedError (" fail" );
386419 });
387420 return mock;
0 commit comments