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

Unified Diff: server/prpc/server_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: server/prpc/server_test.go
diff --git a/server/prpc/server_test.go b/server/prpc/server_test.go
index 664896045d792cad83fb3e97a48bc7e3065461f4..4fe3828ee77b36b17f69b44e808afdebe2142aee 100644
--- a/server/prpc/server_test.go
+++ b/server/prpc/server_test.go
@@ -11,7 +11,6 @@ import (
"strconv"
"testing"
- "github.com/julienschmidt/httprouter"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
@@ -19,7 +18,7 @@ import (
"github.com/luci/luci-go/common/prpc"
prpccommon "github.com/luci/luci-go/common/prpc"
"github.com/luci/luci-go/server/auth"
- "github.com/luci/luci-go/server/middleware"
+ "github.com/luci/luci-go/server/router"
. "github.com/smartystreets/goconvey/convey"
)
@@ -65,8 +64,8 @@ func TestServer(t *testing.T) {
Convey("Handlers", func() {
c := context.Background()
- r := httprouter.New()
- server.InstallHandlers(r, middleware.TestingBase(c))
+ r := router.New()
+ server.InstallHandlers(r, []router.Handler{router.HandlerWithContext(c)})
res := httptest.NewRecorder()
hiMsg := bytes.NewBufferString(`name: "Lucy"`)
req, err := http.NewRequest("POST", "/prpc/prpc.Greeter/SayHello", hiMsg)

Powered by Google App Engine
This is Rietveld 408576698