mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
18 lines
379 B
Go
18 lines
379 B
Go
package apiserver
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestHeartBeat(t *testing.T) {
|
|
lapi := SetupLAPITest(t)
|
|
|
|
w := lapi.RecordResponse(t, http.MethodGet, "/v1/heartbeat", emptyBody, "password")
|
|
assert.Equal(t, 200, w.Code)
|
|
|
|
w = lapi.RecordResponse(t, "POST", "/v1/heartbeat", emptyBody, "password")
|
|
assert.Equal(t, 405, w.Code)
|
|
}
|