Merged in feature/quickfix (pull request #160)

Tests

* tests
This commit is contained in:
Michael McGuinness
2025-06-02 10:50:40 +00:00
parent b8302344b4
commit ae4b456399
2 changed files with 1 additions and 23 deletions
+1 -22
View File
@@ -1,10 +1,8 @@
package endtoend_test
import (
"strings"
"sync"
"testing"
"time"
"queryorchestration/internal/serviceconfig"
"queryorchestration/internal/serviceconfig/aws"
@@ -14,7 +12,6 @@ import (
queryapitest "queryorchestration/internal/test/queryAPI"
queryapi "queryorchestration/pkg/queryAPI"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -75,21 +72,6 @@ func TestProcess(t *testing.T) {
wg.Wait()
test.WaitForMockEndpoint(t, net.Dependencies.MockServer, textractExpectation.Request)
part := uint16(0)
textKey := objectstore.BucketKey{
ClientID: clientId,
EntityID: uuid.New(),
Location: objectstore.Text,
CreatedAt: time.Now().UTC(),
Part: &part,
}
inputFile := strings.NewReader(textractBody)
test.PutObject(t, t.Context(), cfg, test.PutObjectParams{
File: inputFile,
Key: textKey,
})
queryapitest.WaitForClientStatus(t, t.Context(), net.Client, clientId, queryapi.INSYNC)
docs, err := net.Client.ListDocumentsByClientIdWithResponse(t.Context(), clientId)
@@ -110,8 +92,7 @@ func TestProcess(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, docRes)
require.NotNil(t, docRes.JSON200)
fullDoc := *docRes.JSON200
assert.EqualExportedValues(t, expectedDoc, fullDoc)
assert.EqualExportedValues(t, expectedDoc, *docRes.JSON200)
})
t.Run("update config", func(t *testing.T) {
t.Parallel()
@@ -162,7 +143,6 @@ func TestProcess(t *testing.T) {
wg.Wait()
test.WaitForMockEndpoint(t, net.Dependencies.MockServer, textractExpectation.Request)
queryapitest.WaitForClientStatus(t, t.Context(), net.Client, clientId, queryapi.INSYNC)
jcfg := `{"path":"keytwo"}`
@@ -251,7 +231,6 @@ func TestProcess(t *testing.T) {
wg.Wait()
test.WaitForMockEndpoint(t, net.Dependencies.MockServer, textractExpectation.Request)
queryapitest.WaitForClientStatus(t, t.Context(), net.Client, clientId, queryapi.INSYNC)
docs, err := net.Client.ListDocumentsByClientIdWithResponse(t.Context(), clientId)