rename method to endpoint
This commit is contained in:
		| @@ -13,17 +13,17 @@ func TestClient(t *testing.T) { | ||||
| 	} | ||||
|  | ||||
| 	response := []MockResponse{ | ||||
| 		{Method: "Foo.Bar", Response: map[string]interface{}{"foo": "bar"}}, | ||||
| 		{Method: "Foo.Struct", Response: &TestResponse{Param: "aparam"}}, | ||||
| 		{Method: "Foo.Fail", Error: errors.InternalServerError("go.mock", "failed")}, | ||||
| 		{Method: "Foo.Func", Response: func() string { return "string" }}, | ||||
| 		{Method: "Foo.FuncStruct", Response: func() *TestResponse { return &TestResponse{Param: "aparam"} }}, | ||||
| 		{Endpoint: "Foo.Bar", Response: map[string]interface{}{"foo": "bar"}}, | ||||
| 		{Endpoint: "Foo.Struct", Response: &TestResponse{Param: "aparam"}}, | ||||
| 		{Endpoint: "Foo.Fail", Error: errors.InternalServerError("go.mock", "failed")}, | ||||
| 		{Endpoint: "Foo.Func", Response: func() string { return "string" }}, | ||||
| 		{Endpoint: "Foo.FuncStruct", Response: func() *TestResponse { return &TestResponse{Param: "aparam"} }}, | ||||
| 	} | ||||
|  | ||||
| 	c := NewClient(Response("go.mock", response)) | ||||
|  | ||||
| 	for _, r := range response { | ||||
| 		req := c.NewRequest("go.mock", r.Method, map[string]interface{}{"foo": "bar"}) | ||||
| 		req := c.NewRequest("go.mock", r.Endpoint, map[string]interface{}{"foo": "bar"}) | ||||
| 		var rsp interface{} | ||||
|  | ||||
| 		err := c.Call(context.TODO(), req, &rsp) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user