diff options
author | Wolfy-J <[email protected]> | 2018-06-23 20:45:39 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2018-06-23 20:45:39 +0300 |
commit | 2ecba8ab4109108170433862f6d4a29abaac65d8 (patch) | |
tree | 36cfe76e67998f414d7efb00f1a7c030bbfbcfad /service/http/handler_test.go | |
parent | 14a54572d7a3754aeb81d3dc9949276b7fff04fe (diff) | |
parent | 18201f5f6af71fad14bbfc93eec1654b2f8fa585 (diff) |
Merge pull request #22 from spiral/feature/stderr
Feature/stderr
Diffstat (limited to 'service/http/handler_test.go')
-rw-r--r-- | service/http/handler_test.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/service/http/handler_test.go b/service/http/handler_test.go index 4a11c562..59a4c7c0 100644 --- a/service/http/handler_test.go +++ b/service/http/handler_test.go @@ -51,13 +51,13 @@ func TestServer_Echo(t *testing.T) { assert.NoError(t, st.rr.Start()) defer st.rr.Stop() - hs := &http.Server{Addr: ":8077", Handler: st} + hs := &http.Server{Addr: ":8177", Handler: st} defer hs.Shutdown(context.Background()) go func() { hs.ListenAndServe() }() time.Sleep(time.Millisecond * 10) - body, r, err := get("http://localhost:8077/?hello=world") + body, r, err := get("http://localhost:8177/?hello=world") assert.NoError(t, err) assert.Equal(t, 201, r.StatusCode) assert.Equal(t, "WORLD", body) @@ -686,13 +686,13 @@ func TestServer_Error(t *testing.T) { assert.NoError(t, st.rr.Start()) defer st.rr.Stop() - hs := &http.Server{Addr: ":8077", Handler: st} + hs := &http.Server{Addr: ":8177", Handler: st} defer hs.Shutdown(context.Background()) go func() { hs.ListenAndServe() }() time.Sleep(time.Millisecond * 10) - _, r, err := get("http://localhost:8077/?hello=world") + _, r, err := get("http://localhost:8177/?hello=world") assert.NoError(t, err) assert.Equal(t, 500, r.StatusCode) } @@ -720,13 +720,13 @@ func TestServer_Error2(t *testing.T) { assert.NoError(t, st.rr.Start()) defer st.rr.Stop() - hs := &http.Server{Addr: ":8077", Handler: st} + hs := &http.Server{Addr: ":8177", Handler: st} defer hs.Shutdown(context.Background()) go func() { hs.ListenAndServe() }() time.Sleep(time.Millisecond * 10) - _, r, err := get("http://localhost:8077/?hello=world") + _, r, err := get("http://localhost:8177/?hello=world") assert.NoError(t, err) assert.Equal(t, 500, r.StatusCode) } @@ -754,7 +754,7 @@ func TestServer_Error3(t *testing.T) { assert.NoError(t, st.rr.Start()) defer st.rr.Stop() - hs := &http.Server{Addr: ":8077", Handler: st} + hs := &http.Server{Addr: ":8177", Handler: st} defer hs.Shutdown(context.Background()) go func() { hs.ListenAndServe() }() @@ -799,7 +799,7 @@ func BenchmarkHandler_Listen_Echo(b *testing.B) { st.rr.Start() defer st.rr.Stop() - hs := &http.Server{Addr: ":8077", Handler: st} + hs := &http.Server{Addr: ":8177", Handler: st} defer hs.Shutdown(context.Background()) go func() { hs.ListenAndServe() }() @@ -807,7 +807,7 @@ func BenchmarkHandler_Listen_Echo(b *testing.B) { bb := "WORLD" for n := 0; n < b.N; n++ { - r, err := http.Get("http://localhost:8077/?hello=world") + r, err := http.Get("http://localhost:8177/?hello=world") if err != nil { b.Fail() } |