(t *testing.T)
| 835 | } |
| 836 | |
| 837 | func TestWithHealthzEndpoint_serviceParam(t *testing.T) { |
| 838 | service := "test" |
| 839 | |
| 840 | // trigger error to output service in body |
| 841 | dummyClient := dummyHealthCheckClient{status: grpc_health_v1.HealthCheckResponse_UNKNOWN, code: codes.Unknown} |
| 842 | mux := runtime.NewServeMux(runtime.WithHealthzEndpoint(&dummyClient)) |
| 843 | |
| 844 | r := httptest.NewRequest(http.MethodGet, "/healthz?service="+service, nil) |
| 845 | rr := httptest.NewRecorder() |
| 846 | |
| 847 | mux.ServeHTTP(rr, r) |
| 848 | |
| 849 | if !strings.Contains(rr.Body.String(), service) { |
| 850 | t.Errorf( |
| 851 | "service query parameter should be translated to HealthCheckRequest: expected %s to contain %s", |
| 852 | rr.Body.String(), service, |
| 853 | ) |
| 854 | } |
| 855 | } |
| 856 | |
| 857 | func TestWithHealthzEndpoint_header(t *testing.T) { |
| 858 | for _, tt := range healthCheckTests { |
nothing calls this directly
no test coverage detected