diff --git a/grpcstub.go b/grpcstub.go index bd772b5..dc584ed 100644 --- a/grpcstub.go +++ b/grpcstub.go @@ -518,6 +518,7 @@ func (s *Server) ClearMatchers() { s.matchers = nil } +// Prepend prepend matcher. func (s *Server) Prepend() *Server { s.mu.Lock() defer s.mu.Unlock() diff --git a/grpcstub_test.go b/grpcstub_test.go index eb6de77..dfbc337 100644 --- a/grpcstub_test.go +++ b/grpcstub_test.go @@ -814,6 +814,7 @@ func TestPrepend(t *testing.T) { }) ts.Service("routeguide.RouteGuide").Response(map[string]any{"name": "hello"}) ts.Service("routeguide.RouteGuide").Response(map[string]any{"name": "world"}) + ts.Service("routeguide.RouteGuide").Response(map[string]any{"name": "!!!"}) client := routeguide.NewRouteGuideClient(ts.Conn()) res, err := client.GetFeature(ctx, &routeguide.Point{ @@ -837,6 +838,7 @@ func TestPrepend(t *testing.T) { }) ts.Service("routeguide.RouteGuide").Response(map[string]any{"name": "hello"}) ts.Prepend().Service("routeguide.RouteGuide").Response(map[string]any{"name": "world"}) + ts.Service("routeguide.RouteGuide").Response(map[string]any{"name": "!!!"}) client := routeguide.NewRouteGuideClient(ts.Conn()) res, err := client.GetFeature(ctx, &routeguide.Point{