debug_test.go 437 B

12345678910111213141516171819202122
  1. package debug_test
  2. import (
  3. "kpt-tmr-group/http/util/httptt"
  4. "net/http"
  5. "net/http/httptest"
  6. "testing"
  7. "github.com/stretchr/testify/assert"
  8. )
  9. func TestHelloOk(t *testing.T) {
  10. t.Run("ok", func(t *testing.T) {
  11. g, ctrl, _ := fakeServer(t)
  12. defer ctrl.Finish()
  13. req := httptt.NewRequest(t, http.MethodGet, "/debug/test", nil)
  14. rw := httptest.NewRecorder()
  15. g.ServeHTTP(rw, req)
  16. assert.Equal(t, http.StatusOK, rw.Code)
  17. })
  18. }