(t *testing.T)
| 855 | } |
| 856 | |
| 857 | func TestWithHealthzEndpoint_header(t *testing.T) { |
| 858 | for _, tt := range healthCheckTests { |
| 859 | t.Run(tt.name, func(t *testing.T) { |
| 860 | mux := runtime.NewServeMux(runtime.WithHealthzEndpoint(&dummyHealthCheckClient{status: tt.status, code: tt.code})) |
| 861 | |
| 862 | r := httptest.NewRequest(http.MethodGet, "/healthz", nil) |
| 863 | rr := httptest.NewRecorder() |
| 864 | |
| 865 | mux.ServeHTTP(rr, r) |
| 866 | |
| 867 | if actualHeader := rr.Header().Get("Content-Type"); actualHeader != "application/json" { |
| 868 | t.Errorf( |
| 869 | "result http header Content-Type for grpc code %q and status %q should be application/json, got %s", |
| 870 | tt.code, tt.status, actualHeader, |
| 871 | ) |
| 872 | } |
| 873 | }) |
| 874 | } |
| 875 | } |
| 876 | |
| 877 | var _ grpc_health_v1.HealthClient = (*dummyHealthCheckClient)(nil) |
| 878 |
nothing calls this directly
no test coverage detected