func (suite *multiClientSuite) TestSucceeded() {
	cl := &defClient{
		requests:  make(map[string]*client.Request),
		responses: make(map[string]proto.Message),
		errors:    &errorsImpl{},
	}
	cl.SetCaller(ErrorCaller(errors.Forbidden("bad.person", "Much forbid")))

	// A single request should not add any context to the code
	cl.DefaultScopeFrom(ExplicitScoper().SetContext("prefixy"))
	cl.AddScopedReq(&ScopedReq{
		Service:  "com.hailocab.service.foo",
		Endpoint: "health",
		Req:      &hcproto.Request{},
		Rsp:      &hcproto.Response{},
	})
	cl.Execute()
	err := cl.Succeeded("")
	suite.Assertions.NotNil(err)
	suite.Assertions.True(errors.IsForbidden(err))
	suite.Assertions.Equal("bad.person", err.Code())
	suite.Assertions.Equal("Much forbid", err.Description())
}
func (suite *multiClientSuite) TestPlatformError() {
	cl := &defClient{
		requests:  make(map[string]*client.Request),
		responses: make(map[string]proto.Message),
		errors:    &errorsImpl{},
	}
	cl.SetCaller(ErrorCaller(errors.Forbidden("bad.person", "Much forbid")))

	// A single request should not add the suffix provided to PlatformError() but return it verbatim
	cl.AddScopedReq(&ScopedReq{
		Service:  "com.hailocab.service.foo",
		Endpoint: "health",
		Req:      &hcproto.Request{},
		Rsp:      &hcproto.Response{},
	})
	cl.Execute()
	err := cl.PlatformError("suffixy")
	suite.Assertions.NotNil(err)
	suite.Assertions.True(errors.IsForbidden(err))
	suite.Assertions.Equal("bad.person", err.Code())
	suite.Assertions.Equal("Much forbid", err.Description())

	// Multiple errors should use the suffix provided
	cl.Reset()
	cl.AddScopedReq(&ScopedReq{
		Uid:      "uid1",
		Service:  "com.hailocab.service.foo",
		Endpoint: "health",
		Req:      &hcproto.Request{},
		Rsp:      &hcproto.Response{},
	})
	cl.AddScopedReq(&ScopedReq{
		Uid:      "uid2",
		Service:  "com.hailocab.service.foo",
		Endpoint: "bar",
		Req:      &hcproto.Request{},
		Rsp:      &hcproto.Response{},
	})
	cl.Execute()
	err = cl.PlatformError("suffixy")
	suite.Assertions.NotNil(err)
	suite.Assertions.True(errors.IsInternalServerError(err))
	suite.Assertions.Equal("suffixy", err.Code())

	// Multiple errors with a defaultScopeFrom should join the two
	cl.Reset()
	cl.DefaultScopeFrom(ExplicitScoper().SetContext("prefixy"))
	cl.AddScopedReq(&ScopedReq{
		Uid:      "uid1",
		Service:  "com.hailocab.service.foo",
		Endpoint: "health",
		Req:      &hcproto.Request{},
		Rsp:      &hcproto.Response{},
	})
	cl.AddScopedReq(&ScopedReq{
		Uid:      "uid2",
		Service:  "com.hailocab.service.foo",
		Endpoint: "bar",
		Req:      &hcproto.Request{},
		Rsp:      &hcproto.Response{},
	})
	cl.Execute()
	err = cl.PlatformError("suffixy")
	suite.Assertions.NotNil(err)
	suite.Assertions.True(errors.IsInternalServerError(err))
	suite.Assertions.Equal("prefixy.suffixy", err.Code())
}