Merged in feature/textextraction (pull request #110)

Text Extraction

* bases

* go

* splitting

* structure

* movetoasync

* movetoasync

* settinguptrigger

* reorder

* storevent

* standardisepollingvalidation

* unittests

* fixlint

* fixlint

* awscfg

* generatesample

* followthrough

* tests

* clena

* store

* externalidcleanup

* clientid

* local

* baseunittests

* putobjecttests

* tests
This commit is contained in:
Michael McGuinness
2025-04-02 18:50:03 +00:00
parent e6a4cb3990
commit 81e7223560
226 changed files with 17283 additions and 2744 deletions
+9 -20
View File
@@ -13,7 +13,6 @@ import (
"queryorchestration/internal/database/repository"
"queryorchestration/internal/serviceconfig"
"github.com/google/uuid"
"github.com/labstack/echo/v4"
"github.com/pashagolub/pgxmock/v3"
"github.com/stretchr/testify/assert"
@@ -45,10 +44,8 @@ func TestCreateClient(t *testing.T) {
rec := httptest.NewRecorder()
ctx := e.NewContext(req, rec)
pool.ExpectQuery("name: CreateClient :one").WithArgs(body.Id, body.Name).WillReturnRows(
pgxmock.NewRows([]string{"id"}).
AddRow(uuid.New()),
)
pool.ExpectExec("name: CreateClient :exec").WithArgs(body.Id, body.Name).
WillReturnResult(pgxmock.NewResult("", 1))
err = cons.CreateClient(ctx)
require.NoError(t, err)
@@ -74,13 +71,12 @@ func TestGetClient(t *testing.T) {
ctx := e.NewContext(req, rec)
id := "client_id"
clientUid := uuid.New()
ctx.Set("id", id)
pool.ExpectQuery("name: GetClientByExternalId :one").WithArgs(id).WillReturnRows(
pgxmock.NewRows([]string{"id", "externalId", "name", "canSync"}).
AddRow(clientUid, "client_id", "client_name", true),
pool.ExpectQuery("name: GetClient :one").WithArgs(id).WillReturnRows(
pgxmock.NewRows([]string{"id", "name", "canSync"}).
AddRow("client_id", "client_name", true),
)
err = cons.GetClient(ctx, id)
@@ -92,7 +88,6 @@ func TestGetClient(t *testing.T) {
require.NoError(t, err)
assert.EqualExportedValues(t, queryapi.DocClient{
Id: id,
Uid: clientUid,
Name: "client_name",
CanSync: true,
}, res)
@@ -127,18 +122,12 @@ func TestUpdateClient(t *testing.T) {
ctx.Set("id", id)
intid := uuid.New()
pool.ExpectQuery("name: GetClientByExternalId :one").WithArgs(id).WillReturnRows(
pgxmock.NewRows([]string{"id", "externalId", "name", "canSync"}).
AddRow(intid, "clientid", "client_name", true),
)
pool.ExpectQuery("name: GetClient :one").WithArgs(intid).WillReturnRows(
pgxmock.NewRows([]string{"id", "externalId", "name", "canSync"}).
AddRow(intid, "clientid", "client_name", true),
pool.ExpectQuery("name: GetClient :one").WithArgs(id).WillReturnRows(
pgxmock.NewRows([]string{"id", "name", "canSync"}).
AddRow("clientid", "client_name", true),
)
pool.ExpectBegin()
pool.ExpectExec("name: AddClientCanSync :exec").WithArgs(*body.CanSync, intid).
pool.ExpectExec("name: AddClientCanSync :exec").WithArgs(*body.CanSync, id).
WillReturnResult(pgxmock.NewResult("", 1))
pool.ExpectCommit()