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