Merged in feature/docresult (pull request #105)

Document Result Endpoint

* testing

* cleantesting

* progress

* query

* lint

* readme

* dockerclient

* api

* passtest

* tests

* test
This commit is contained in:
Michael McGuinness
2025-03-17 18:14:15 +00:00
parent f7c41c4ef3
commit 555b6d420b
105 changed files with 3276 additions and 2484 deletions
+45
View File
@@ -0,0 +1,45 @@
package queryapi_test
import (
"net/http"
"net/http/httptest"
"strings"
"testing"
queryapi "queryorchestration/api/queryAPI"
"github.com/go-playground/validator/v10"
"github.com/google/uuid"
"github.com/labstack/echo/v4"
"github.com/stretchr/testify/assert"
)
func TestTriggerExport(t *testing.T) {
e := echo.New()
req := httptest.NewRequest(http.MethodPost, "/", strings.NewReader(""))
rec := httptest.NewRecorder()
ctx := e.NewContext(req, rec)
cons := queryapi.NewControllers(validator.New(), &queryapi.Services{})
err := cons.TriggerExport(ctx, "clientid")
assert.NoError(t, err)
assert.Equal(t, http.StatusOK, rec.Code)
assert.NotEmpty(t, rec.Body.String())
}
func TestExportState(t *testing.T) {
e := echo.New()
req := httptest.NewRequest(http.MethodPost, "/", strings.NewReader(""))
rec := httptest.NewRecorder()
ctx := e.NewContext(req, rec)
cons := queryapi.NewControllers(validator.New(), &queryapi.Services{})
id := uuid.New()
err := cons.ExportState(ctx, id)
assert.NoError(t, err)
assert.Equal(t, http.StatusOK, rec.Code)
assert.NotEmpty(t, rec.Body.String())
}