INNER CODE UNIT · Go
TestClient_RecordEvent_ValidatesEventAndDoesNotPutItToQueue
samsara/samsara · clients/go/client_test.go:301
func TestClient_RecordEvent_ValidatesEventAndDoesNotPutItToQueue(t *testing.T) {
config := NewConfig()
config.Url = "http://test.com"
config.StartPublishingThread = false
config.MaxBufferSize = 1
config.MinBufferSize = 1
config.SourceId = "secret"
client, _ := NewClient(config)
event := Event{
"eventName": "foo-bar-baz",
"timestamp": "incorrect-stamp",
}
err := client.RecordEvent(event)
if err == nil {
t.Error("Error should be raised.")