0
0
mirror of https://github.com/google/googletest.git synced 2025-03-20 19:03:48 +00:00
googletest/googlemock/g3doc/includes/g3_stubby_actions.md
2021-01-13 20:58:40 -05:00

1.1 KiB

Stubby Actions

gMock has the following actions to provide limited support for mocking Stubby (go/stubby) services. You can use them to return a canned answer from a Stubby call, which has the signature void Method(RPC*, const Request*, Response* response, Closure* done). You should consider using Service Mocker (go/servicemocker) instead if your need is more complex.

`BeDone()` Calls the `done` closure.
`FailWith(status)` Fails the RPC with the given RPC status code.
`FailWithUtilStatus(util_status)` Fails the RPC with the given util::Status error code.
`RespondWith(proto)` Sets the `response` argument to the given protocol buffer, and calls the `done` closure.
`RespondWith(proto_string)` Sets the `response` argument to the protocol buffer parsed from the given ASCII string, and calls the `done` closure.