Test: remote handler get & request chan operations / Modify: GET request to remote server should return error http status code

This commit is contained in:
HFO4
2020-01-04 15:17:27 +08:00
parent aeca161186
commit 93dc25aabb
10 changed files with 249 additions and 44 deletions

View File

@@ -51,7 +51,7 @@ func TestRemoteCallback(t *testing.T) {
"http://test/test/url",
testMock.Anything,
testMock.Anything,
).Return(Response{
).Return(&Response{
Err: nil,
Response: &http.Response{
StatusCode: 200,
@@ -75,7 +75,7 @@ func TestRemoteCallback(t *testing.T) {
"http://test/test/url",
testMock.Anything,
testMock.Anything,
).Return(Response{
).Return(&Response{
Err: nil,
Response: &http.Response{
StatusCode: 200,
@@ -99,7 +99,7 @@ func TestRemoteCallback(t *testing.T) {
"http://test/test/url",
testMock.Anything,
testMock.Anything,
).Return(Response{
).Return(&Response{
Err: nil,
Response: &http.Response{
StatusCode: 404,
@@ -123,7 +123,7 @@ func TestRemoteCallback(t *testing.T) {
"http://test/test/url",
testMock.Anything,
testMock.Anything,
).Return(Response{
).Return(&Response{
Err: errors.New("error"),
})
GeneralClient = clientMock