diff --git a/samples/client/petstore/go/petStore_test.go b/samples/client/petstore/go/petApi_test.go similarity index 79% rename from samples/client/petstore/go/petStore_test.go rename to samples/client/petstore/go/petApi_test.go index e3df602c3b8..e56468849cd 100644 --- a/samples/client/petstore/go/petStore_test.go +++ b/samples/client/petstore/go/petApi_test.go @@ -8,7 +8,6 @@ import ( ) func TestAddPet(t *testing.T) { - t.Log("Testing TestAddPet...") s := sw.NewPetApi() newPet := (sw.Pet{Id: 12830, Name: "gopher", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}) @@ -23,7 +22,6 @@ func TestAddPet(t *testing.T) { func TestGetPetById(t *testing.T) { assert := assert.New(t) - t.Log("Testing TestGetPetById...") s := sw.NewPetApi() resp, err := s.GetPetById(12830) @@ -31,7 +29,7 @@ func TestGetPetById(t *testing.T) { t.Errorf("Error while getting pet by id") t.Log(err) } else { - assert.Equal(resp.Id, 12830, "Pet id should be equal") + assert.Equal(resp.Id, "12830", "Pet id should be equal") assert.Equal(resp.Name, "gopher", "Pet name should be gopher") assert.Equal(resp.Status, "pending", "Pet status should be pending") @@ -40,10 +38,8 @@ func TestGetPetById(t *testing.T) { } func TestUpdatePetWithForm(t *testing.T) { - t.Log("Testing UpdatePetWithForm...") - s := sw.NewPetApi() - err := s.UpdatePetWithForm("12830", "golang", "available") + err := s.UpdatePetWithForm(12830, "golang", "available") if err != nil { t.Errorf("Error while updating pet by id") diff --git a/samples/client/petstore/go/swagger/ApiResponse.go b/samples/client/petstore/go/swagger/ApiResponse.go new file mode 100644 index 00000000000..c9d3ac40834 --- /dev/null +++ b/samples/client/petstore/go/swagger/ApiResponse.go @@ -0,0 +1,10 @@ +package swagger + +import ( +) + +type ApiResponse struct { + Code int32 `json:"code,omitempty"` +Type_ string `json:"type,omitempty"` +Message string `json:"message,omitempty"` +}