2022-05-19 13:47:27 +00:00
|
|
|
package apiserver
|
|
|
|
|
|
|
|
import (
|
2022-08-16 07:46:10 +00:00
|
|
|
"net/http"
|
2022-05-19 13:47:27 +00:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestHeartBeat(t *testing.T) {
|
|
|
|
lapi := SetupLAPITest(t)
|
|
|
|
|
2024-01-04 16:10:36 +00:00
|
|
|
w := lapi.RecordResponse(t, http.MethodGet, "/v1/heartbeat", emptyBody, "password")
|
2022-05-19 13:47:27 +00:00
|
|
|
assert.Equal(t, 200, w.Code)
|
|
|
|
|
2024-01-04 16:10:36 +00:00
|
|
|
w = lapi.RecordResponse(t, "POST", "/v1/heartbeat", emptyBody, "password")
|
2022-05-19 13:47:27 +00:00
|
|
|
assert.Equal(t, 405, w.Code)
|
|
|
|
}
|