harness-drone/handler/health/health_test.go
2019-05-21 13:29:58 -07:00

21 lines
482 B
Go

// 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.
package health
import (
"net/http/httptest"
"testing"
)
func TestHandleHealthz(t *testing.T) {
w := httptest.NewRecorder()
r := httptest.NewRequest("GET", "/healthz", nil)
Handler().ServeHTTP(w, r)
if got, want := w.Code, 200; want != got {
t.Errorf("Want response code %d, got %d", want, got)
}
}