Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iszak committed Feb 1, 2019
1 parent 9f5ceb6 commit 0ef471c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion example/gen/gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package gen

import (
"context"
"encoding/xml"
"time"

Expand Down Expand Up @@ -39,7 +40,7 @@ func NewStockQuotePortType(client *soap.Client) StockQuotePortType {

func (service *stockQuotePortType) GetLastTradePrice(request *TradePriceRequest) (*TradePrice, error) {
response := new(TradePrice)
err := service.client.Call("http://example.com/GetLastTradePrice", request, response)
err := service.client.Call(context.Background(), "http://example.com/GetLastTradePrice", request, response)
if err != nil {
return nil, err
}
Expand Down
5 changes: 3 additions & 2 deletions soap/soap_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package soap

import (
"context"
"encoding/xml"
"net/http"
"net/http/httptest"
Expand Down Expand Up @@ -52,7 +53,7 @@ func TestClient_Call(t *testing.T) {
client := NewClient(ts.URL)
req := &Ping{Request: &PingRequest{Message: "Hi"}}
reply := &PingResponse{}
if err := client.Call("GetData", req, reply); err != nil {
if err := client.Call(context.Background(), "GetData", req, reply); err != nil {
t.Fatalf("couln't call service: %v", err)
}

Expand Down Expand Up @@ -105,7 +106,7 @@ func TestClient_Send_Correct_Headers(t *testing.T) {
client := NewClient(ts.URL, WithHTTPHeaders(test.reqHeaders))
req := struct{}{}
reply := struct{}{}
client.Call(test.action, req, reply)
client.Call(context.Background(), test.action, req, reply)

for k, v := range test.expectedHeaders {
h := gotHeaders.Get(k)
Expand Down

0 comments on commit 0ef471c

Please sign in to comment.