This test verifies that a gRPC future is properly set once the given call is processed by the server.
| 126 | // This test verifies that a gRPC future is properly set once the |
| 127 | // given call is processed by the server. |
| 128 | TEST_F(GRPCClientTest, Success) |
| 129 | { |
| 130 | PingPongServer server; |
| 131 | Try<client::Connection> connection = server.startup(); |
| 132 | ASSERT_SOME(connection); |
| 133 | |
| 134 | client::Runtime runtime; |
| 135 | |
| 136 | Future<Try<Pong, StatusError>> pong = runtime.call( |
| 137 | connection.get(), |
| 138 | GRPC_CLIENT_METHOD(PingPong, Send), |
| 139 | Ping(), |
| 140 | call_options()); |
| 141 | |
| 142 | AWAIT_ASSERT_READY(pong); |
| 143 | EXPECT_SOME(pong.get()); |
| 144 | |
| 145 | runtime.terminate(); |
| 146 | AWAIT_ASSERT_READY(runtime.wait()); |
| 147 | |
| 148 | ASSERT_SOME(server.shutdown()); |
| 149 | } |
| 150 | |
| 151 | |
| 152 | // This test verifies that we can have multiple outstanding gRPC calls. |