chore(server): add testing with healthz router. (#526)

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2020-06-23 13:58:40 +08:00 committed by GitHub
parent 36a2e181aa
commit 7b7d27f16c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -353,7 +353,7 @@ func TestMetricsHandler(t *testing.T) {
})
}
func TestHeartbeatHandler(t *testing.T) {
func TestGETHeartbeatHandler(t *testing.T) {
initTest()
r := gofight.New()
@ -364,6 +364,17 @@ func TestHeartbeatHandler(t *testing.T) {
})
}
func TestHEADHeartbeatHandler(t *testing.T) {
initTest()
r := gofight.New()
r.HEAD("/healthz").
Run(routerEngine(), func(r gofight.HTTPResponse, rq gofight.HTTPRequest) {
assert.Equal(t, http.StatusOK, r.Code)
})
}
func TestVersionHandler(t *testing.T) {
SetVersion("3.0.0")
initTest()