@@ -54,7 +54,6 @@ using ::testing::IsEmpty;
5454using ::testing::MockFunction;
5555using ::testing::Not;
5656using ::testing::Optional;
57- using ::testing::Pair;
5857using ::testing::ResultOf;
5958using ::testing::Return;
6059
@@ -300,12 +299,21 @@ TEST(BigtableStubFactory, FeaturesFlagsCloudDirectPath) {
300299 auto headers = fixture.GetMetadata (context);
301300 auto it = headers.find (" bigtable-features" );
302301 EXPECT_NE (it, headers.end ());
302+ if (it == headers.end ())
303+ return internal::AbortedError (" header not found" );
303304 auto decoded = internal::UrlsafeBase64Decode (it->second );
304305 EXPECT_STATUS_OK (decoded);
305306 if (!decoded) return internal::AbortedError (" fail to decode" );
306307 google::bigtable::v2::FeatureFlags proto;
307308 EXPECT_TRUE (proto.ParseFromArray (
308309 decoded->data (), static_cast <int >(decoded->size ())));
310+ EXPECT_TRUE (proto.reverse_scans ());
311+ EXPECT_TRUE (proto.last_scanned_row_responses ());
312+ EXPECT_TRUE (proto.mutate_rows_rate_limit ());
313+ EXPECT_TRUE (proto.mutate_rows_rate_limit2 ());
314+ EXPECT_TRUE (proto.routing_cookie ());
315+ EXPECT_TRUE (proto.retry_info ());
316+ EXPECT_TRUE (proto.peer_info ());
309317 EXPECT_TRUE (proto.traffic_director_enabled ());
310318 EXPECT_TRUE (proto.direct_access_requested ());
311319 return internal::AbortedError (" fail" );
@@ -341,11 +349,20 @@ TEST(BigtableStubFactory, FeaturesFlagsBigtableDirectPath) {
341349 auto it = headers.find (" bigtable-features" );
342350 EXPECT_NE (it, headers.end ());
343351 auto decoded = internal::UrlsafeBase64Decode (it->second );
352+ if (it == headers.end ())
353+ return internal::AbortedError (" header not found" );
344354 EXPECT_STATUS_OK (decoded);
345355 if (!decoded) return internal::AbortedError (" fail to decode" );
346356 google::bigtable::v2::FeatureFlags proto;
347357 EXPECT_TRUE (proto.ParseFromArray (
348358 decoded->data (), static_cast <int >(decoded->size ())));
359+ EXPECT_TRUE (proto.reverse_scans ());
360+ EXPECT_TRUE (proto.last_scanned_row_responses ());
361+ EXPECT_TRUE (proto.mutate_rows_rate_limit ());
362+ EXPECT_TRUE (proto.mutate_rows_rate_limit2 ());
363+ EXPECT_TRUE (proto.routing_cookie ());
364+ EXPECT_TRUE (proto.retry_info ());
365+ EXPECT_TRUE (proto.peer_info ());
349366 EXPECT_TRUE (proto.traffic_director_enabled ());
350367 EXPECT_TRUE (proto.direct_access_requested ());
351368 return internal::AbortedError (" fail" );
@@ -378,10 +395,25 @@ TEST(BigtableStubFactory, FeaturesFlags) {
378395 google::bigtable::v2::MutateRowRequest const &) {
379396 ValidateMetadataFixture fixture;
380397 auto headers = fixture.GetMetadata (context);
381- EXPECT_THAT (
382- headers,
383- Contains (Pair (" bigtable-features" ,
384- AllOf (Not (IsEmpty ()), IsWebSafeBase64 ()))));
398+ auto it = headers.find (" bigtable-features" );
399+ EXPECT_NE (it, headers.end ());
400+ if (it == headers.end ())
401+ return internal::AbortedError (" header not found" );
402+ auto decoded = internal::UrlsafeBase64Decode (it->second );
403+ EXPECT_STATUS_OK (decoded);
404+ if (!decoded) return internal::AbortedError (" fail to decode" );
405+ google::bigtable::v2::FeatureFlags proto;
406+ EXPECT_TRUE (proto.ParseFromArray (
407+ decoded->data (), static_cast <int >(decoded->size ())));
408+ EXPECT_TRUE (proto.reverse_scans ());
409+ EXPECT_TRUE (proto.last_scanned_row_responses ());
410+ EXPECT_TRUE (proto.mutate_rows_rate_limit ());
411+ EXPECT_TRUE (proto.mutate_rows_rate_limit2 ());
412+ EXPECT_TRUE (proto.routing_cookie ());
413+ EXPECT_TRUE (proto.retry_info ());
414+ EXPECT_TRUE (proto.peer_info ());
415+ EXPECT_FALSE (proto.traffic_director_enabled ());
416+ EXPECT_FALSE (proto.direct_access_requested ());
385417 return internal::AbortedError (" fail" );
386418 });
387419 return mock;
0 commit comments