package borealis import ( "encoding/json" "testing" ) const ( expectedEventJSON = `{"type":"1","sequential_id":2,"timestamp":"2009-01-03T19:15:08.004+01:00","unique_id":"Z5ZWs1U9RoGQVugoz5SIrkmkj9T","payload":"Testing"}` ) func TestEncodeEventJSON(t *testing.T) { output, err := json.Marshal(expectedEvent) if err != nil { t.Error(err) } actual := string(output) if actual != expectedEventJSON { t.Errorf("expected %v, but got %v", expectedEventJSON, actual) } }