(t *testing.T)
| 28 | } |
| 29 | |
| 30 | func TestVerifyHTTP_RedirectToSuccess(t *testing.T) { |
| 31 | server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 32 | if r.URL.Path == "/" { |
| 33 | http.Redirect(w, r, "/home", http.StatusFound) |
| 34 | return |
| 35 | } |
| 36 | w.WriteHeader(http.StatusOK) |
| 37 | })) |
| 38 | defer server.Close() |
| 39 | |
| 40 | app := &Application{ |
| 41 | Settings: ApplicationSettings{Host: server.Listener.Addr().String(), DisableTLS: true}, |
| 42 | } |
| 43 | |
| 44 | err := app.verifyHTTP(context.Background()) |
| 45 | assert.NoError(t, err) |
| 46 | } |
| 47 | |
| 48 | func TestVerifyHTTP_ServerError(t *testing.T) { |
| 49 | server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…