Skip to content

Commit 9630356

Browse files
committed
fix grpc/tests: use ::testing::NiceMock
It is ok not to mock all methods commit_hash:cf9131a7d2c3076cbc3f752218865f72d77602a6
1 parent 2ffad48 commit 9630356

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

grpc/tests/server_middleware_hooks_streaming_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const grpc::Status kUnknownErrorStatus{
2828
grpc::StatusCode::UNKNOWN,
2929
"The service method has exited unexpectedly, without providing a status"};
3030

31-
class UnitTestServiceMock final : public sample::ugrpc::UnitTestServiceBase {
31+
class UnitTestServiceMock : public sample::ugrpc::UnitTestServiceBase {
3232
public:
3333
MOCK_METHOD(ChatResult, Chat, (ugrpc::server::CallContext& /*context*/, ChatReaderWriter& /*stream*/), (override));
3434
};
@@ -41,7 +41,7 @@ struct Flags final {
4141

4242
class ServerMiddlewareHooksStreamingTest : public tests::MiddlewaresFixture<
4343
tests::server::ServerMiddlewareBaseMock,
44-
UnitTestServiceMock,
44+
::testing::NiceMock<UnitTestServiceMock>,
4545
sample::ugrpc::UnitTestServiceClient,
4646
/*N=*/3> {
4747
protected:

grpc/tests/server_middleware_hooks_unary_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const grpc::Status kUnknownErrorStatus{
3030

3131
const grpc::Status kUnimplementedStatus{grpc::StatusCode::UNIMPLEMENTED, "This method is unimplemented"};
3232

33-
class MessengerMock final : public sample::ugrpc::UnitTestServiceBase {
33+
class UnitTestServiceMock : public sample::ugrpc::UnitTestServiceBase {
3434
public:
3535
MOCK_METHOD(
3636
SayHelloResult,
@@ -47,7 +47,7 @@ struct Flags final {
4747
// NOLINTNEXTLINE(fuchsia-multiple-inheritance)
4848
class ServerMiddlewareHooksUnaryTest : public tests::MiddlewaresFixture<
4949
tests::server::ServerMiddlewareBaseMock,
50-
MessengerMock,
50+
::testing::NiceMock<UnitTestServiceMock>,
5151
sample::ugrpc::UnitTestServiceClient,
5252
/*N=*/3>,
5353
public testing::WithParamInterface<Flags> {

0 commit comments

Comments
 (0)