(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestVerifyHTTP_Success(t *testing.T) { |
| 14 | var requestPath string |
| 15 | server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 16 | requestPath = r.URL.Path |
| 17 | w.WriteHeader(http.StatusOK) |
| 18 | })) |
| 19 | defer server.Close() |
| 20 | |
| 21 | app := &Application{ |
| 22 | Settings: ApplicationSettings{Host: server.Listener.Addr().String(), DisableTLS: true}, |
| 23 | } |
| 24 | |
| 25 | err := app.verifyHTTP(context.Background()) |
| 26 | assert.NoError(t, err) |
| 27 | assert.Equal(t, HealthCheckPath, requestPath) |
| 28 | } |
| 29 | |
| 30 | func TestVerifyHTTP_RedirectToSuccess(t *testing.T) { |
| 31 | server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…