Commit aa83e7e5 authored by Eric Chiang's avatar Eric Chiang Committed by GitHub

Merge pull request #589 from ericchiang/dev-health-check-add-test

server: add a test for the health check handler
parents e873a31b 9243a092
package server
import (
"net/http"
"net/http/httptest"
"testing"
)
func TestHandleHealth(t *testing.T) {
httpServer, server := newTestServer(t, nil)
defer httpServer.Close()
rr := httptest.NewRecorder()
server.handleHealth(rr, httptest.NewRequest("GET", "/healthz", nil))
if rr.Code != http.StatusOK {
t.Errorf("expected 200 got %d", rr.Code)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment