Updated test for json format
This commit is contained in:
parent
bd7567380b
commit
89cdeec055
|
@ -25,6 +25,19 @@ func TestFormatMetric(t *testing.T) {
|
||||||
}
|
}
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
k := &KinesisOutput{
|
||||||
|
Format: "json",
|
||||||
|
}
|
||||||
|
|
||||||
|
valid_json := "{\"fields\":{\"value\":1},\"name\":\"docker\",\"tags\":{\"tag1\":\"value1\"},\"timestamp\":1257894000}"
|
||||||
|
func_json, err := FormatMetric(k, p)
|
||||||
|
|
||||||
|
if func_json != valid_json {
|
||||||
|
t.Error("Expected ", valid_json)
|
||||||
|
t.Error("Found ", func_json)
|
||||||
|
}
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
k = &KinesisOutput{
|
k = &KinesisOutput{
|
||||||
Format: "custom",
|
Format: "custom",
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue