Merged in feature/apitidyup (pull request #24)

Export API Clean Up

* exportapi
This commit is contained in:
Michael McGuinness
2025-01-16 13:49:07 +00:00
parent 174644b63c
commit f5d2808c7a
7 changed files with 421 additions and 40 deletions
+17
View File
@@ -8,6 +8,7 @@ import (
"testing"
"github.com/go-playground/validator/v10"
"github.com/google/uuid"
"github.com/labstack/echo/v4"
"github.com/stretchr/testify/assert"
)
@@ -25,3 +26,19 @@ func TestTriggerExport(t *testing.T) {
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 := queryservice.NewControllers(validator.New(), &queryservice.Services{})
id := uuid.NewString()
err := cons.ExportState(ctx, id)
assert.Nil(t, err)
assert.Equal(t, http.StatusOK, rec.Code)
assert.NotEmpty(t, rec.Body.String())
}