Skip to content

Commit

Permalink
can'r reproduce err in the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
momom-i committed Sep 3, 2021
1 parent dbe2d42 commit d58c595
Show file tree
Hide file tree
Showing 7 changed files with 716 additions and 97 deletions.
30 changes: 29 additions & 1 deletion examples/internal/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,35 @@ func TestEcho(t *testing.T) {
}
}

func TestEchoOneOf(t *testing.T) {
if testing.Short() {
t.Skip()
return
}
// 1. error occurs because of field already set for oneof. that's expected error as usual
apiURL := "http://localhost:8088/v1/example/echo_test_one_of?line_num=1&lang=a"
// 2. error doesn't occur. that's weird
// apiURL := "http://localhost:8088/v1/example/echo_test_one_of?test1.id1=1&test1.name1=foo"
// 3. error doesn't occur. that's weird
// apiURL := "http://localhost:8088/v1/example/echo_test_one_of?test1.id1=1&test2.id1=2"
resp, err := http.Get(apiURL)
if err != nil {
t.Errorf("http.Get(%q) failed with %v; want success", apiURL, err)
return
}
defer resp.Body.Close()
buf, err := ioutil.ReadAll(resp.Body)
if err != nil {
t.Errorf("ioutil.ReadAll(resp.Body) failed with %v; want success", err)
return
}
var received examplepb.TestMessage
if err := marshaler.Unmarshal(buf, &received); err != nil {
t.Errorf("marshaler.Unmarshal(%s, msg) failed with %v; want success", buf, err)
return
}
}

func TestEchoPatch(t *testing.T) {
if testing.Short() {
t.Skip()
Expand Down Expand Up @@ -1566,7 +1595,6 @@ func TestNotImplemented(t *testing.T) {
t.Errorf("ioutil.ReadAll(resp.Body) failed with %v; want success", err)
return
}

if got, want := resp.StatusCode, http.StatusNotImplemented; got != want {
t.Errorf("resp.StatusCode = %d; want %d", got, want)
t.Logf("%s", buf)
Expand Down
Loading

0 comments on commit d58c595

Please sign in to comment.