You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2016/12/12 20:29:12 UTC
[06/33] incubator-trafficcontrol git commit: update Profile struct to
include ID
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/2fd04931
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/2fd04931
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/2fd04931
Branch: refs/heads/psql-rebase
Commit: 2fd0493164821bdfdb0394003650f515b6bafa7e
Parents: 7e5f5cc
Author: David Neuman <da...@gmail.com>
Authored: Wed Nov 30 09:09:23 2016 -0700
Committer: Dave Neuman <ne...@apache.org>
Committed: Fri Dec 2 15:22:55 2016 -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/2fd04931/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/2fd04931/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/2fd04931/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 {