Merge pull request #12480 from influxdata/fix/telegraf-links

fix(http/telegraf): add missing member/owner test links
pull/12497/head
Chris Goller 2019-03-10 23:08:31 -05:00 committed by GitHub
commit af9d4bf483
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 6 deletions

View File

@ -77,6 +77,8 @@ func TestTelegrafHandler_handleGetTelegrafs(t *testing.T) {
"labels": [], "labels": [],
"links": { "links": {
"labels": "/api/v2/telegrafs/0000000000000001/labels", "labels": "/api/v2/telegrafs/0000000000000001/labels",
"members": "/api/v2/telegrafs/0000000000000001/members",
"owners": "/api/v2/telegrafs/0000000000000001/owners",
"self": "/api/v2/telegrafs/0000000000000001" "self": "/api/v2/telegrafs/0000000000000001"
}, },
"id":"0000000000000001", "id":"0000000000000001",
@ -137,13 +139,14 @@ func TestTelegrafHandler_handleGetTelegrafs(t *testing.T) {
wants: wants{ wants: wants{
statusCode: http.StatusOK, statusCode: http.StatusOK,
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
// TODO(goller): once links are in for telegraf, this will need to change.
body: `{ body: `{
"configurations": [ "configurations": [
{ {
"labels": [], "labels": [],
"links": { "links": {
"labels": "/api/v2/telegrafs/0000000000000001/labels", "labels": "/api/v2/telegrafs/0000000000000001/labels",
"members": "/api/v2/telegrafs/0000000000000001/members",
"owners": "/api/v2/telegrafs/0000000000000001/owners",
"self": "/api/v2/telegrafs/0000000000000001" "self": "/api/v2/telegrafs/0000000000000001"
}, },
"id": "0000000000000001", "id": "0000000000000001",
@ -265,6 +268,8 @@ func TestTelegrafHandler_handleGetTelegraf(t *testing.T) {
"labels": [], "labels": [],
"links": { "links": {
"labels": "/api/v2/telegrafs/0000000000000001/labels", "labels": "/api/v2/telegrafs/0000000000000001/labels",
"members": "/api/v2/telegrafs/0000000000000001/members",
"owners": "/api/v2/telegrafs/0000000000000001/owners",
"self": "/api/v2/telegrafs/0000000000000001" "self": "/api/v2/telegrafs/0000000000000001"
}, },
"plugins": [ "plugins": [
@ -337,6 +342,8 @@ func TestTelegrafHandler_handleGetTelegraf(t *testing.T) {
"labels": [], "labels": [],
"links": { "links": {
"labels": "/api/v2/telegrafs/0000000000000001/labels", "labels": "/api/v2/telegrafs/0000000000000001/labels",
"members": "/api/v2/telegrafs/0000000000000001/members",
"owners": "/api/v2/telegrafs/0000000000000001/owners",
"self": "/api/v2/telegrafs/0000000000000001" "self": "/api/v2/telegrafs/0000000000000001"
}, },
"plugins": [ "plugins": [
@ -397,7 +404,6 @@ func TestTelegrafHandler_handleGetTelegraf(t *testing.T) {
wants: wants{ wants: wants{
statusCode: http.StatusOK, statusCode: http.StatusOK,
contentType: "application/toml; charset=utf-8", contentType: "application/toml; charset=utf-8",
// TODO(goller): once links are in for telegraf, this will need to change.
body: `# Configuration for telegraf agent body: `# Configuration for telegraf agent
[agent] [agent]
## Default data collection interval for all inputs ## Default data collection interval for all inputs
@ -513,7 +519,6 @@ func TestTelegrafHandler_handleGetTelegraf(t *testing.T) {
wants: wants{ wants: wants{
statusCode: http.StatusOK, statusCode: http.StatusOK,
contentType: "application/toml; charset=utf-8", contentType: "application/toml; charset=utf-8",
// TODO(goller): once links are in for telegraf, this will need to change.
body: `# Configuration for telegraf agent body: `# Configuration for telegraf agent
[agent] [agent]
## Default data collection interval for all inputs ## Default data collection interval for all inputs
@ -630,7 +635,6 @@ func TestTelegrafHandler_handleGetTelegraf(t *testing.T) {
wants: wants{ wants: wants{
statusCode: http.StatusOK, statusCode: http.StatusOK,
contentType: "application/octet-stream", contentType: "application/octet-stream",
// TODO(goller): once links are in for telegraf, this will need to change.
body: `# Configuration for telegraf agent body: `# Configuration for telegraf agent
[agent] [agent]
## Default data collection interval for all inputs ## Default data collection interval for all inputs
@ -792,8 +796,10 @@ func Test_newTelegrafResponses(t *testing.T) {
"labels": [ "labels": [
], ],
"links": { "links": {
"labels": "/api/v2/telegrafs/0000000000000001/labels", "labels": "/api/v2/telegrafs/0000000000000001/labels",
"self": "/api/v2/telegrafs/0000000000000001" "members": "/api/v2/telegrafs/0000000000000001/members",
"owners": "/api/v2/telegrafs/0000000000000001/owners",
"self": "/api/v2/telegrafs/0000000000000001"
}, },
"id": "0000000000000001", "id": "0000000000000001",
"organizationID": "0000000000000002", "organizationID": "0000000000000002",