(pb *probe.Probe)
| 30 | ) |
| 31 | |
| 32 | func generateHandler(pb *probe.Probe) http.HandlerFunc { |
| 33 | return func(w http.ResponseWriter, r *http.Request) { |
| 34 | if !pb.IsHealthy() { |
| 35 | w.WriteHeader(http.StatusInternalServerError) |
| 36 | _, _ = w.Write([]byte("unhealthy")) |
| 37 | return |
| 38 | } |
| 39 | |
| 40 | w.WriteHeader(http.StatusOK) |
| 41 | _, _ = w.Write([]byte("healthy")) |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | func TestHandlerSuccessTCP(t *testing.T) { |
| 46 | t.Parallel() |
no test coverage detected