#include <userver/ugrpc/tests/service_fixtures.hpp>
Sets up a mini gRPC server and construct a client for it.
Definition at line 46 of file service_fixtures.hpp.
Inheritance diagram for ugrpc::tests::ServiceWithClientFixture< GrpcService, ClientType >:Public Member Functions | |
| template<typename... Args> | |
| ServiceWithClientFixture (Args &&... args) | |
| Passes args to the service fixture. | |
| ClientType & | GetClient () |
Protected Member Functions | |
| utils::statistics::Snapshot | GetStatistics (std::string prefix, std::vector< utils::statistics::Label > require_labels={}) |
| GrpcService & | GetService () |
| void | RegisterService (server::ServiceBase &service) |
| void | RegisterService (server::GenericServiceBase &service) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| void | StartServer (client::ClientFactorySettings &&settings={}) |
| void | StopServer () noexcept |
| template<typename Client> | |
| Client | MakeClient () |
| server::Server & | GetServer () noexcept |
| void | SetServerMiddlewares (server::Middlewares middlewares) |
| Server middlewares can be modified before the first RegisterService call. | |
| void | SetClientMiddlewares (client::Middlewares middlewares) |
| Client middlewares can be modified before the first RegisterService call. | |
| void | ExtendDynamicConfig (const std::vector< dynamic_config::KeyValue > &) |
| dynamic_config::Source | GetConfigSource () const |
| utils::statistics::Storage & | GetStatisticsStorage () |
|
inlineexplicit |
Passes args to the service fixture.
Definition at line 50 of file service_fixtures.hpp.
|
inherited |
Modifies the internal dynamic configs storage. It is used by the server and clients, and is accessible through GetConfigSource. Initially, the configs are filled with compile-time defaults.
|
inline |
Definition at line 55 of file service_fixtures.hpp.
|
inherited |
|
noexceptinherited |
|
inlineinherited |
Definition at line 165 of file service.hpp.
|
inlineprotectedinherited |
Definition at line 36 of file service_fixtures.hpp.
|
inherited |
|
inlineinherited |
Definition at line 60 of file service.hpp.
|
inherited |
Register a gRPC service implementation. The caller owns the service and should ensure that the services live at least until StopServer is called.
|
inherited |
Starts the server and connects a grpc channel to it. Should be called after the services are registered.
|
noexceptinherited |
Should be called before the registered services are destroyed. Should typically be called in the destructor of your gtest fixture.