crowdsec/pkg/apiserver/heartbeat_test.go
Thibault "bui" Koechlin fe09737d80
Add support for machine heartbeat (#1541)
* add the last_heartbeat field

* add heartbeat controller

* add endpoint of heartbeat

* heartbeat integration

* add last_heartbeat to cscli machines list
2022-05-19 15:47:27 +02:00

18 lines
328 B
Go

package apiserver
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestHeartBeat(t *testing.T) {
lapi := SetupLAPITest(t)
w := lapi.RecordResponse("GET", "/v1/heartbeat", emptyBody)
assert.Equal(t, 200, w.Code)
w = lapi.RecordResponse("POST", "/v1/heartbeat", emptyBody)
assert.Equal(t, 405, w.Code)
}