chore(server): add testing with healthz router. (#526)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user