Merged in feature/clientexternalid (pull request #99)
Client External ID * normalizeexternalid * cleanopenapi * cleanopenapi * changingpublic * noprecommit * testing * precommit * processtest * nodb * tests * tests
This commit is contained in:
@@ -48,14 +48,12 @@ func TestDocInitRunner(t *testing.T) {
|
||||
assert.NotNil(t, runner)
|
||||
|
||||
t.Run("valid", func(t *testing.T) {
|
||||
j := client.Client{
|
||||
ID: uuid.New(),
|
||||
}
|
||||
clientId := uuid.New()
|
||||
bucketName := "bucketName"
|
||||
location := fmt.Sprintf("%s/aaa", j.ID.String())
|
||||
location := fmt.Sprintf("%s/aaa", clientId)
|
||||
docinfo := document.Document{
|
||||
ID: uuid.New(),
|
||||
ClientID: j.ID,
|
||||
ClientID: clientId,
|
||||
Hash: "example_hash",
|
||||
}
|
||||
doc := S3EventNotification{
|
||||
@@ -81,11 +79,11 @@ func TestDocInitRunner(t *testing.T) {
|
||||
Body: &body,
|
||||
}
|
||||
|
||||
pool.ExpectQuery("name: GetDocumentIDByHash :one").WithArgs(docinfo.Hash, database.MustToDBUUID(j.ID)).WillReturnRows(
|
||||
pool.ExpectQuery("name: GetDocumentIDByHash :one").WithArgs(docinfo.Hash, database.MustToDBUUID(clientId)).WillReturnRows(
|
||||
pgxmock.NewRows([]string{"id"}),
|
||||
)
|
||||
pool.ExpectBegin()
|
||||
pool.ExpectQuery("name: CreateDocument :one").WithArgs(database.MustToDBUUID(j.ID), docinfo.Hash).
|
||||
pool.ExpectQuery("name: CreateDocument :one").WithArgs(database.MustToDBUUID(clientId), docinfo.Hash).
|
||||
WillReturnRows(
|
||||
pgxmock.NewRows([]string{"id"}).
|
||||
AddRow(database.MustToDBUUID(docinfo.ID)),
|
||||
|
||||
Reference in New Issue
Block a user