| 568 | class MyGrpcHealthReporter : public brpc::HealthReporter { |
| 569 | public: |
| 570 | void GenerateReport(brpc::Controller* cntl, |
| 571 | google::protobuf::Closure* done) { |
| 572 | grpc::health::v1::HealthCheckResponse response; |
| 573 | response.set_status(grpc::health::v1::HealthCheckResponse_ServingStatus_UNKNOWN); |
| 574 | |
| 575 | if (cntl->response()) { |
| 576 | cntl->response()->CopyFrom(response); |
| 577 | } else { |
| 578 | std::string json; |
| 579 | json2pb::ProtoMessageToJson(response, &json); |
| 580 | cntl->http_response().set_content_type("application/json"); |
| 581 | cntl->response_attachment().append(json); |
| 582 | } |
| 583 | done->Run(); |
| 584 | } |
| 585 | }; |
| 586 | |
| 587 | TEST_F(BuiltinServiceTest, normal_grpc_health) { |
nothing calls this directly
no test coverage detected