Skip to content

Commit

Permalink
Update baz endpoint tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuntao Lu committed Apr 20, 2017
1 parent 8cb587e commit d2af6aa
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 64 deletions.
165 changes: 112 additions & 53 deletions examples/example-gateway/build/clients/baz/baz_test_server.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/example-gateway/build/endpoints/baz/baz_structs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestCallSuccessfulRequestOKResponse(t *testing.T) {
}
defer gateway.Close()

gateway.TChannelBackends()["baz"].Register(bazServer.NewServerWithSimpleServiceCall(call))
gateway.TChannelBackends()["baz"].Register(bazServer.NewSimpleServiceCallHandler(call))

headers := map[string]string{}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ func TestCompareSuccessfulRequestOKResponse(t *testing.T) {
}
defer gateway.Close()

gateway.TChannelBackends()["baz"].Register(bazServer.NewServerWithSimpleServiceCompare(compare))
gateway.TChannelBackends()["baz"].Register(bazServer.NewSimpleServiceCompareHandler(compare))

headers := map[string]string{}

res, err := gateway.MakeRequest(
"POST",
"/baz/compare",
headers,
bytes.NewReader([]byte(`{"Arg1":{"b1":true,"s2":"hello","i3":42},"Arg2":{"b1":true,"s2":"hola","i3":42}}`)),
bytes.NewReader([]byte(`{"arg1":{"b1":true,"s2":"hello","i3":42},"arg2":{"b1":true,"s2":"hola","i3":42}}`)),
)

if !assert.NoError(t, err, "got http error") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestPingSuccessfulRequestOKResponse(t *testing.T) {
}
defer gateway.Close()

gateway.TChannelBackends()["baz"].Register(bazServer.NewServerWithSimpleServicePing(ping))
gateway.TChannelBackends()["baz"].Register(bazServer.NewSimpleServicePingHandler(ping))

headers := map[string]string{}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestSillyNoopFutureSuccessfulRequestOKResponse(t *testing.T) {
}
defer gateway.Close()

gateway.TChannelBackends()["baz"].Register(bazServer.NewServerWithSimpleServiceSillyNoop(sillyNoop))
gateway.TChannelBackends()["baz"].Register(bazServer.NewSimpleServiceSillyNoopHandler(sillyNoop))

headers := map[string]string{}

Expand Down

0 comments on commit d2af6aa

Please sign in to comment.