diff --git a/.travis.yml b/.travis.yml index 413f1db..d029676 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,5 +4,6 @@ go: - 1.5.3 - - 1.6 - #- tip + - 1.6.3 + - 1.7 + - tip diff --git a/transport/httprp/server_test.go b/transport/httprp/server_test.go index 06946a7..50f7415 100644 --- a/transport/httprp/server_test.go +++ b/transport/httprp/server_test.go @@ -13,11 +13,10 @@ ) func TestServerHappyPathSingleServer(t *testing.T) { - originServer := httptest.NewServer( - http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) - w.Write([]byte("hey")) - })) + originServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + w.Write([]byte("hey")) + })) defer originServer.Close() originURL, _ := url.Parse(originServer.URL) @@ -35,7 +34,7 @@ responseBody, _ := ioutil.ReadAll(resp.Body) if want, have := "hey", string(responseBody); want != have { - t.Errorf("want %d, have %d", want, have) + t.Errorf("want %q, have %q", want, have) } } @@ -45,15 +44,14 @@ headerVal = "go-kit-proxy" ) - originServer := httptest.NewServer( - http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if want, have := headerVal, r.Header.Get(headerKey); want != have { - t.Errorf("want %d, have %d", want, have) - } + originServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if want, have := headerVal, r.Header.Get(headerKey); want != have { + t.Errorf("want %q, have %q", want, have) + } - w.WriteHeader(http.StatusOK) - w.Write([]byte("hey")) - })) + w.WriteHeader(http.StatusOK) + w.Write([]byte("hey")) + })) defer originServer.Close() originURL, _ := url.Parse(originServer.URL) @@ -75,7 +73,7 @@ responseBody, _ := ioutil.ReadAll(resp.Body) if want, have := "hey", string(responseBody); want != have { - t.Errorf("want %d, have %d", want, have) + t.Errorf("want %q, have %q", want, have) } } @@ -99,10 +97,9 @@ func TestServerOriginServerUnreachable(t *testing.T) { // create a server, then promptly shut it down - originServer := httptest.NewServer( - http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) - })) + originServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + })) originURL, _ := url.Parse(originServer.URL) originServer.Close() @@ -114,7 +111,7 @@ defer proxyServer.Close() resp, _ := http.Get(proxyServer.URL) - if want, have := http.StatusInternalServerError, resp.StatusCode; want != have { + if want, have := http.StatusBadGateway, resp.StatusCode; want != have { t.Errorf("want %d, have %d", want, have) } }