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)
|
|
|
|
|
2022-08-16 07:46:10 +00:00
|
|
|
w := lapi.RecordResponse(http.MethodGet, "/v1/heartbeat", emptyBody, "password")
|
2022-05-19 13:47:27 +00:00
|
|
|
assert.Equal(t, 200, w.Code)
|
|
|
|
|
2022-06-08 14:05:52 +00:00
|
|
|
w = lapi.RecordResponse("POST", "/v1/heartbeat", emptyBody, "password")
|
2022-05-19 13:47:27 +00:00
|
|
|
assert.Equal(t, 405, w.Code)
|
|
|
|
}
|