update Profile struct to include ID
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/b5831f43 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/b5831f43 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/b5831f43 Branch: refs/heads/master Commit: b5831f437ee04b86aa52d24640ce920c3c756dfd Parents: 470e561 Author: David Neuman <david.neuma...@gmail.com> Authored: Wed Nov 30 09:09:23 2016 -0700 Committer: Dan Kirkwood <dang...@gmail.com> Committed: Sun Jan 8 21:04:59 2017 -0700 ---------------------------------------------------------------------- traffic_ops/client/fixtures/profile.go | 1 + traffic_ops/client/profile.go | 1 + traffic_ops/client/tests/profile_test.go | 6 ++++++ 3 files changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b5831f43/traffic_ops/client/fixtures/profile.go ---------------------------------------------------------------------- diff --git a/traffic_ops/client/fixtures/profile.go b/traffic_ops/client/fixtures/profile.go index 6ef2da5..8bf6be1 100644 --- a/traffic_ops/client/fixtures/profile.go +++ b/traffic_ops/client/fixtures/profile.go @@ -22,6 +22,7 @@ func Profiles() *client.ProfileResponse { return &client.ProfileResponse{ Response: []client.Profile{ client.Profile{ + ID: 1, Name: "TR_CDN2", Description: "kabletown Content Router", LastUpdated: "2012-10-08 13:34:45", http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b5831f43/traffic_ops/client/profile.go ---------------------------------------------------------------------- diff --git a/traffic_ops/client/profile.go b/traffic_ops/client/profile.go index a770780..90f3f4d 100644 --- a/traffic_ops/client/profile.go +++ b/traffic_ops/client/profile.go @@ -24,6 +24,7 @@ type ProfileResponse struct { // Profile ... type Profile struct { + ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` LastUpdated string `json:"lastUpdated"` http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b5831f43/traffic_ops/client/tests/profile_test.go ---------------------------------------------------------------------- diff --git a/traffic_ops/client/tests/profile_test.go b/traffic_ops/client/tests/profile_test.go index 3b9cc7f..7c89897 100644 --- a/traffic_ops/client/tests/profile_test.go +++ b/traffic_ops/client/tests/profile_test.go @@ -51,6 +51,12 @@ func TestProfile(t *testing.T) { } for _, p := range profiles { + if p.ID != 1 { + testHelper.Error(t, "Should get back 1 for \"ID\", got: %s", p.Name) + } else { + testHelper.Success(t, "Should get back 1 for \"ID\"") + } + if p.Name != "TR_CDN2" { testHelper.Error(t, "Should get back \"TR_CDN2\" for \"Name\", got: %s", p.Name) } else {