newJsonParser function is now unexported, must use NewParser(config)
This commit is contained in:
@@ -26,7 +26,11 @@ func TestHTTPwithJSONFormat(t *testing.T) {
|
||||
URLs: []string{url},
|
||||
}
|
||||
metricName := "metricName"
|
||||
p, _ := parsers.NewJSONParser(metricName, nil, nil, nil)
|
||||
config := &parsers.Config{
|
||||
DataFormat: "json",
|
||||
MetricName: "metricName",
|
||||
}
|
||||
p, _ := parsers.NewParser(config)
|
||||
plugin.SetParser(p)
|
||||
|
||||
var acc testutil.Accumulator
|
||||
@@ -63,8 +67,12 @@ func TestHTTPHeaders(t *testing.T) {
|
||||
URLs: []string{url},
|
||||
Headers: map[string]string{header: headerValue},
|
||||
}
|
||||
metricName := "metricName"
|
||||
p, _ := parsers.NewJSONParser(metricName, nil, nil, nil)
|
||||
|
||||
config := &parsers.Config{
|
||||
DataFormat: "json",
|
||||
MetricName: "metricName",
|
||||
}
|
||||
p, _ := parsers.NewParser(config)
|
||||
plugin.SetParser(p)
|
||||
|
||||
var acc testutil.Accumulator
|
||||
@@ -83,7 +91,11 @@ func TestInvalidStatusCode(t *testing.T) {
|
||||
}
|
||||
|
||||
metricName := "metricName"
|
||||
p, _ := parsers.NewJSONParser(metricName, nil, nil, nil)
|
||||
config := &parsers.Config{
|
||||
DataFormat: "json",
|
||||
MetricName: metricName,
|
||||
}
|
||||
p, _ := parsers.NewParser(config)
|
||||
plugin.SetParser(p)
|
||||
|
||||
var acc testutil.Accumulator
|
||||
@@ -105,8 +117,11 @@ func TestMethod(t *testing.T) {
|
||||
Method: "POST",
|
||||
}
|
||||
|
||||
metricName := "metricName"
|
||||
p, _ := parsers.NewJSONParser(metricName, nil, nil, nil)
|
||||
config := &parsers.Config{
|
||||
DataFormat: "json",
|
||||
MetricName: "metricName",
|
||||
}
|
||||
p, _ := parsers.NewParser(config)
|
||||
plugin.SetParser(p)
|
||||
|
||||
var acc testutil.Accumulator
|
||||
|
||||
Reference in New Issue
Block a user