Files
query-orchestration/test/queryService/openapi_test.go
T

34 lines
810 B
Go
Raw Normal View History

2025-01-15 19:45:51 +00:00
package integration_test
import (
"context"
"fmt"
"net/http"
"queryorchestration/internal/test"
"testing"
"github.com/stretchr/testify/assert"
)
func TestQueryServiceOpenAPI(t *testing.T) {
ctx := context.Background()
address, cleanup := test.CreateAPIWithDependencies(t, ctx, "queryService")
defer cleanup()
resp, err := http.Get(fmt.Sprintf("%s/swagger/doc.json", address))
assert.Nil(t, err)
assert.NotNil(t, resp)
assert.Equal(t, http.StatusOK, resp.StatusCode)
resp, err = http.Get(fmt.Sprintf("%s/swagger/doc.yaml", address))
assert.Nil(t, err)
assert.NotNil(t, resp)
assert.Equal(t, http.StatusOK, resp.StatusCode)
resp, err = http.Get(fmt.Sprintf("%s/swagger/index.html", address))
assert.Nil(t, err)
assert.NotNil(t, resp)
assert.Equal(t, http.StatusOK, resp.StatusCode)
}