jolokia: use always POST

code refactor to use same prepareRequest method
for both 'agent' and 'proxy' mode

closes #1031
closes #1050
closes #473
This commit is contained in:
Simone Aiello
2016-04-15 00:38:46 +02:00
committed by Cameron Sparr
parent cf5980ace2
commit 18636ea628
4 changed files with 116 additions and 136 deletions

View File

@@ -48,7 +48,7 @@ const empty = ""
var Servers = []Server{Server{Name: "as1", Host: "127.0.0.1", Port: "8080"}}
var HeapMetric = Metric{Name: "heap_memory_usage",
Mbean: "java.lang:type=Memory", Attribute: "HeapMemoryUsage" }
Mbean: "java.lang:type=Memory", Attribute: "HeapMemoryUsage"}
var UsedHeapMetric = Metric{Name: "heap_memory_usage",
Mbean: "java.lang:type=Memory", Attribute: "HeapMemoryUsage"}
@@ -96,9 +96,9 @@ func TestHttpJsonMultiValue(t *testing.T) {
"heap_memory_usage_used": 203288528.0,
}
tags := map[string]string{
"host": "127.0.0.1",
"port": "8080",
"server": "as1",
"server_host": "127.0.0.1",
"server_port": "8080",
"server_name": "as1",
}
acc.AssertContainsTaggedFields(t, "jolokia", fields, tags)
}
@@ -117,7 +117,6 @@ func TestHttpJsonOn404(t *testing.T) {
assert.Equal(t, 0, len(acc.Metrics))
}
// Test that the proper values are ignored or collected
func TestHttpInvalidJson(t *testing.T) {