func TestS3APINotFound(t *testing.T) {
	st := newServerTesterTLSConnectPort([]string{"--npn-list=spdy/3.1", "-f127.0.0.1,3010;api"}, t, func(w http.ResponseWriter, r *http.Request) {
		t.Fatalf("request should not be forwarded")
	}, 3010)
	defer st.Close()

	res, err := st.spdy(requestParam{
		name:   "TestS3APINotFound",
		path:   "/api/notfound",
		method: "GET",
		body: []byte(`# comment
backend=127.0.0.1,3011

`),
	})
	if err != nil {
		t.Fatalf("Error st.spdy() = %v", err)
	}
	if got, want := res.status, 404; got != want {
		t.Errorf("res.status: %v; want %v", got, want)
	}

	var apiResp APIResponse
	err = json.Unmarshal(res.body, &apiResp)
	if err != nil {
		t.Fatalf("Error unmarshaling API response: %v", err)
	}
	if got, want := apiResp.Status, "Failure"; got != want {
		t.Errorf("apiResp.Status: %v; want %v", got, want)
	}
	if got, want := apiResp.Code, 404; got != want {
		t.Errorf("apiResp.Status: %v; want %v", got, want)
	}
}
// TestS3APINotFound exercise backendconfig API endpoint routine when
// API endpoint is not found.

TestS3APINotFound exercise backendconfig API endpoint routine when
API endpoint is not found.
// TestS3APINotFound exercise backendconfig API endpoint routine when // API endpoint is not found .
func TestS3APINotFound(t *testing.T) {
	st := newServerTesterTLSConnectPort([]string{"--npn-list=spdy/3.1", "-f127.0.0.1,3010;api"}, t, func(w http.ResponseWriter, r *http.Request) {
		t.Fatalf("request should not be forwarded")
	}, 3010)
	defer st.Close()
	res, err := st.spdy(requestParam{
		name:   "TestS3APINotFound",
		path:   "/api/notfound",
		method: "GET",
		body: []byte(`# comment
backend=127.0.0.1,3011
`),
	})
	if err != nil {
		t.Fatalf("Error st.spdy() = %v", err)
	}
	if got, want := res.status, 404; got != want {
		t.Errorf("res.status: %v; want %v", got, want)
	}
	var apiResp APIResponse
	err = json.Unmarshal(res.body, &apiResp)
	if err != nil {
		t.Fatalf("Error unmarshaling API response: %v", err)
	}
	if got, want := apiResp.Status, "Failure"; got != want {
		t.Errorf("apiResp.Status: %v; want %v", got, want)
	}
	if got, want := apiResp.Code, 404; got != want {
		t.Errorf("apiResp.Status: %v; want %v", got, want)
	}
}
func TestS3APINotFound ( t * testing . T ) { st := newServerTesterTLSConnectPort ( [ ] string { " " , " " } , t , func ( w http . ResponseWriter , r * http . Request ) { t . Fatalf ( " " ) } , 3010 ) defer st . Close ( ) res , err := st . spdy ( requestParam { name : " " , path : " " , method : " " , body : [ ] byte ( `# comment
backend=127.0.0.1,3011

` ) , } ) if err != nil { t . Fatalf ( " " , err ) } if got , want := res . status , 404 ; got != want { t . Errorf ( " " , got , want ) } var apiResp APIResponse err = json . Unmarshal ( res . body , & apiResp ) if err != nil { t . Fatalf ( " " , err ) } if got , want := apiResp . Status , " " ; got != want { t . Errorf ( " " , got , want ) } if got , want := apiResp . Code , 404 ; got != want { t . Errorf ( " " , got , want ) } }
TestS3APINotFound exercise backendconfig API endpoint routine when
API endpoint is not found.
TestS3APINotFound exercise backendconfig API endpoint routine when API endpoint is not found .