From 1886df560169d9f747f56d9f1b3901f43fa6854d Mon Sep 17 00:00:00 2001 From: Vivek Singh Chauhan Date: Mon, 16 Sep 2024 16:50:05 +0100 Subject: [PATCH] INT - Fix unit tests --- discovery/pkg/apigee/pollproductsjob_test.go | 22 +++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/discovery/pkg/apigee/pollproductsjob_test.go b/discovery/pkg/apigee/pollproductsjob_test.go index 3ce851b..d3dc506 100644 --- a/discovery/pkg/apigee/pollproductsjob_test.go +++ b/discovery/pkg/apigee/pollproductsjob_test.go @@ -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 }