mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-17 06:52:26 +02:00
20 lines
434 B
Go
20 lines
434 B
Go
package apiserver
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestHeartBeat(t *testing.T) {
|
|
ctx := context.Background()
|
|
lapi := SetupLAPITest(t, ctx)
|
|
|
|
w := lapi.RecordResponse(t, ctx, http.MethodGet, "/v1/heartbeat", emptyBody, "password")
|
|
assert.Equal(t, 200, w.Code)
|
|
|
|
w = lapi.RecordResponse(t, ctx, "POST", "/v1/heartbeat", emptyBody, "password")
|
|
assert.Equal(t, 405, w.Code)
|
|
}
|