Skip to content

Commit

Permalink
INT - Fix unit tests (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekschauhan authored Sep 18, 2024
1 parent 9b2bef1 commit 82f166b
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion discovery/pkg/apigee/pollproductsjob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,29 @@ func (m mockProductClient) GetProduct(productName string) (*models.ApiProduct, e
return products[productName], nil
}

const oasSpec = `{
"openapi": "3.0.0",
"servers": [
{
"url": "http://svr/api/v1"
}
],
"info": {
"version": "1.0.0",
"title": "Swagger Petstore"
},
"paths": {
"/pet": {
"get": {
"summary": "Finds Pets by status"
}
}
}
}`

func (m mockProductClient) GetSpecFile(path string) ([]byte, error) {
assert.Equal(m.t, specPath, path)
return []byte("spec"), nil
return []byte(oasSpec), nil
}

func (m mockProductClient) IsReady() bool { return false }
Expand Down

0 comments on commit 82f166b

Please sign in to comment.