From 15559701c7e19e4e24232aaef8421476532cbb12 Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Thu, 10 Dec 2015 16:38:29 -0800 Subject: [PATCH] Copied generated id and names --- nomad/job_endpoint_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nomad/job_endpoint_test.go b/nomad/job_endpoint_test.go index d9f20f4e1..53934bf21 100644 --- a/nomad/job_endpoint_test.go +++ b/nomad/job_endpoint_test.go @@ -356,6 +356,19 @@ func TestJobEndpoint_GetJob(t *testing.T) { // do a deep equal with the response from the GET JOB Api j := job j.TaskGroups[0].Tasks[0].Services[0].Name = "web-frontend" + for tgix, tg := range j.TaskGroups { + for tidx, t := range tg.Tasks { + for sidx, service := range t.Services { + service.Id = resp2.Job.TaskGroups[tgix].Tasks[tidx].Services[sidx].Id + for cidx, check := range service.Checks { + check.Name = resp2.Job.TaskGroups[tgix].Tasks[tidx].Services[sidx].Checks[cidx].Name + check.Id = resp2.Job.TaskGroups[tgix].Tasks[tidx].Services[sidx].Checks[cidx].Id + } + } + } + } + j.TaskGroups[0].Tasks[0].Services[0].Id = resp2.Job.TaskGroups[0].Tasks[0].Services[0].Id + if !reflect.DeepEqual(j, resp2.Job) { t.Fatalf("bad: %#v %#v", job, resp2.Job) }