Allow JSON data format to contain zero metrics (#3268)
(cherry picked from commit 22a9ffbb9d)
This commit is contained in:
committed by
Daniel Nelson
parent
0e0da57b9a
commit
47b2d04d5b
@@ -477,15 +477,13 @@ func TestHttpJsonBadJson(t *testing.T) {
|
||||
assert.Equal(t, 0, acc.NFields())
|
||||
}
|
||||
|
||||
// Test response to empty string as response objectgT
|
||||
// Test response to empty string as response object
|
||||
func TestHttpJsonEmptyResponse(t *testing.T) {
|
||||
httpjson := genMockHttpJson(empty, 200)
|
||||
|
||||
var acc testutil.Accumulator
|
||||
err := acc.GatherError(httpjson[0].Gather)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, 0, acc.NFields())
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
// Test that the proper values are ignored or collected
|
||||
|
||||
Reference in New Issue
Block a user