From 956212bdcd1570c4aef1509f3dd2442cd9cd37ad Mon Sep 17 00:00:00 2001 From: Anna Levenberg Date: Thu, 18 Jan 2024 11:08:22 -0500 Subject: [PATCH] til: InvokeWithoutArgs exists --- .../pubsub/internal/pull_ack_handler_factory_test.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/google/cloud/pubsub/internal/pull_ack_handler_factory_test.cc b/google/cloud/pubsub/internal/pull_ack_handler_factory_test.cc index f41c62494969b..5433e5b24064e 100644 --- a/google/cloud/pubsub/internal/pull_ack_handler_factory_test.cc +++ b/google/cloud/pubsub/internal/pull_ack_handler_factory_test.cc @@ -38,6 +38,7 @@ using ::testing::AllOf; using ::testing::ByMove; using ::testing::Contains; using ::testing::ElementsAre; +using ::testing::InvokeWithoutArgs; using ::testing::IsEmpty; using ::testing::Property; using ::testing::Return; @@ -73,7 +74,8 @@ TEST(PullAckHandlerTest, AckSimple) { // Since the lease manager is started in the constructor of the ack handler, // we need to match the lease manager calls. EXPECT_CALL(*mock, AsyncModifyAckDeadline(_, _, _)) - .WillRepeatedly(Return(make_ready_future(Status{}))); + .WillRepeatedly( + InvokeWithoutArgs([]() { return make_ready_future(Status{}); })); AsyncSequencer aseq; auto cq = MakeMockCompletionQueue(aseq); auto handler = @@ -107,7 +109,8 @@ TEST(PullAckHandlerTest, TracingEnabled) { // Since the lease manager is started in the constructor of the ack handler, // we need to match the lease manager calls. EXPECT_CALL(*mock, AsyncModifyAckDeadline(_, _, _)) - .WillRepeatedly(Return(make_ready_future(Status{}))); + .WillRepeatedly( + InvokeWithoutArgs([]() { return make_ready_future(Status{}); })); AsyncSequencer aseq; auto cq = MakeMockCompletionQueue(aseq); auto handler = @@ -135,7 +138,9 @@ TEST(PullAckHandlerTest, TracingDisabled) { // Since the lease manager is started in the constructor of the ack handler, // we need to match the lease manager calls. EXPECT_CALL(*mock, AsyncModifyAckDeadline(_, _, _)) - .WillRepeatedly(Return(make_ready_future(Status{}))); + .WillRepeatedly( + InvokeWithoutArgs([]() { return make_ready_future(Status{}); })); + AsyncSequencer aseq; auto cq = MakeMockCompletionQueue(aseq); auto handler =