Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2618)

Unified Diff: appengine/gaeauth/server/internal/authdb/handlers_test.go

Issue 2043423004: Make HTTP middleware easier to use (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Update tests Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/gaeauth/server/internal/authdb/handlers_test.go
diff --git a/appengine/gaeauth/server/internal/authdb/handlers_test.go b/appengine/gaeauth/server/internal/authdb/handlers_test.go
index 9584d0c42fa361aa60f019b65a7190a9fcfcfb1b..8cbd13426491d6e6bd5668c3c80bdbc5f5bb8121 100644
--- a/appengine/gaeauth/server/internal/authdb/handlers_test.go
+++ b/appengine/gaeauth/server/internal/authdb/handlers_test.go
@@ -14,6 +14,7 @@ import (
"github.com/luci/luci-go/appengine/gaetesting"
"github.com/luci/luci-go/server/auth/service"
+ "github.com/luci/luci-go/server/router"
. "github.com/smartystreets/goconvey/convey"
)
@@ -22,7 +23,7 @@ func TestPubSubHandlers(t *testing.T) {
Convey("pubSubPush skips when not configured", t, func() {
c := gaetesting.TestingContext()
rec := httptest.NewRecorder()
- pubSubPush(c, rec, makePostRequest(), nil)
+ pubSubPush(&router.Context{Context: c, Writer: rec, Request: makePostRequest(), Params: nil})
So(rec.Code, ShouldEqual, 200)
So(rec.Body.String(), ShouldEqual, "Auth Service URL is not configured, skipping the message")
})
@@ -30,7 +31,7 @@ func TestPubSubHandlers(t *testing.T) {
Convey("pubSubPush works when no notification", t, func() {
c, _ := setupCtx()
rec := httptest.NewRecorder()
- pubSubPush(c, rec, makePostRequest(), nil)
+ pubSubPush(&router.Context{Context: c, Writer: rec, Request: makePostRequest(), Params: nil})
So(rec.Code, ShouldEqual, 200)
So(rec.Body.String(), ShouldEqual, "No new valid AuthDB change notifications")
})
@@ -39,7 +40,7 @@ func TestPubSubHandlers(t *testing.T) {
c, srv := setupCtx()
srv.Notification = &service.Notification{Revision: 122} // older than 123
rec := httptest.NewRecorder()
- pubSubPush(c, rec, makePostRequest(), nil)
+ pubSubPush(&router.Context{Context: c, Writer: rec, Request: makePostRequest(), Params: nil})
So(rec.Code, ShouldEqual, 200)
So(rec.Body.String(), ShouldEqual, "Processed PubSub notification for rev 122: 123 -> 123")
})
@@ -49,7 +50,7 @@ func TestPubSubHandlers(t *testing.T) {
srv.LatestRev = 130
srv.Notification = &service.Notification{Revision: 124}
rec := httptest.NewRecorder()
- pubSubPush(c, rec, makePostRequest(), nil)
+ pubSubPush(&router.Context{Context: c, Writer: rec, Request: makePostRequest(), Params: nil})
So(rec.Code, ShouldEqual, 200)
So(rec.Body.String(), ShouldEqual, "Processed PubSub notification for rev 124: 123 -> 130")
})

Powered by Google App Engine
This is Rietveld 408576698