harness-drone/handler/health/health_test.go

22 lines
482 B
Go
Raw Normal View History

2019-02-19 23:56:41 +00:00
// Copyright 2019 Drone.IO Inc. All rights reserved.
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.
2019-05-21 20:29:58 +00:00
package health
2019-02-19 23:56:41 +00:00
import (
"net/http/httptest"
"testing"
)
func TestHandleHealthz(t *testing.T) {
w := httptest.NewRecorder()
r := httptest.NewRequest("GET", "/healthz", nil)
2019-05-21 20:29:58 +00:00
Handler().ServeHTTP(w, r)
2019-02-19 23:56:41 +00:00
if got, want := w.Code, 200; want != got {
t.Errorf("Want response code %d, got %d", want, got)
}
}