(t *testing.T)
| 46 | } |
| 47 | |
| 48 | func TestVerifyHTTP_ServerError(t *testing.T) { |
| 49 | server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 50 | w.WriteHeader(http.StatusInternalServerError) |
| 51 | })) |
| 52 | defer server.Close() |
| 53 | |
| 54 | app := &Application{ |
| 55 | Settings: ApplicationSettings{Host: server.Listener.Addr().String(), DisableTLS: true}, |
| 56 | } |
| 57 | |
| 58 | err := app.verifyHTTP(context.Background()) |
| 59 | require.Error(t, err) |
| 60 | assert.ErrorIs(t, err, ErrVerificationFailed) |
| 61 | assert.Contains(t, err.Error(), "unexpected status 500") |
| 62 | } |
| 63 | |
| 64 | func TestVerifyHTTP_Unreachable(t *testing.T) { |
| 65 | app := &Application{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…