github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/fly/integration/verify_plan_handler_test.go (about) 1 package integration_test 2 3 import ( 4 "encoding/json" 5 "net/http" 6 7 "github.com/pf-qiu/concourse/v6/atc" 8 "github.com/pf-qiu/concourse/v6/atc/testhelpers" 9 "github.com/onsi/gomega" 10 ) 11 12 func VerifyPlan(expectedPlan atc.Plan) http.HandlerFunc { 13 return func(w http.ResponseWriter, r *http.Request) { 14 var plan atc.Plan 15 err := json.NewDecoder(r.Body).Decode(&plan) 16 gomega.Expect(err).ToNot(gomega.HaveOccurred()) 17 18 gomega.Expect(plan).To(testhelpers.MatchPlan(expectedPlan)) 19 } 20 }