mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 23:57:31 +00:00
fix(query): keys (#2755)
* fix: add keys to projections * change to multiple tables * query keys * query keys * fix race condition * fix timer reset * begin tests * tests * remove migration * only send to keyChannel if not nil
This commit is contained in:
@@ -3,7 +3,6 @@ package query
|
||||
import (
|
||||
"database/sql"
|
||||
"database/sql/driver"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
@@ -13,7 +12,7 @@ import (
|
||||
|
||||
"github.com/DATA-DOG/go-sqlmock"
|
||||
sq "github.com/Masterminds/squirrel"
|
||||
"github.com/nsf/jsondiff"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -58,8 +57,7 @@ func assertPrepare(t *testing.T, prepareFunc, expectedObject interface{}, sqlExp
|
||||
return false
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(object, expectedObject) {
|
||||
prettyPrintDiff(t, expectedObject, object)
|
||||
if !assert.Equal(t, expectedObject, object) {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -315,19 +313,3 @@ func TestValidatePrepare(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func prettyPrintDiff(t *testing.T, expected, gotten interface{}) {
|
||||
t.Helper()
|
||||
|
||||
expectedMarshalled, _ := json.Marshal(expected)
|
||||
objectMarshalled, _ := json.Marshal(gotten)
|
||||
_, diff := jsondiff.Compare(
|
||||
expectedMarshalled,
|
||||
objectMarshalled,
|
||||
&jsondiff.Options{
|
||||
SkipMatches: true,
|
||||
Indent: " ",
|
||||
ChangedSeparator: " is expected, got ",
|
||||
})
|
||||
t.Errorf("unexpected object: want %T, got %T, difference:\n%s", expected, gotten, diff)
|
||||
}
|
||||
|
Reference in New Issue
Block a user