Extend PostgreSQL implementation and unit tests on MongoDB storage
This commit is contained in:
67
storage/storage_test.go
Normal file
67
storage/storage_test.go
Normal file
@@ -0,0 +1,67 @@
|
||||
package storage
|
||||
|
||||
import "github.com/google/uuid"
|
||||
|
||||
var account1 = Account{
|
||||
ID: uuid.NewString(),
|
||||
Namespace: "namespace",
|
||||
Authentication: AccountAuth{
|
||||
Local: &LocalAuth{
|
||||
Username: Ptr("test"),
|
||||
Password: "hashedpassword",
|
||||
Email: Ptr("test@test.com"),
|
||||
EmailValidation: &Validation{
|
||||
Validated: true,
|
||||
ValidationCode: "",
|
||||
},
|
||||
PhoneNumber: Ptr("+3312345678"),
|
||||
PhoneNumberValidation: &Validation{
|
||||
Validated: true,
|
||||
ValidationCode: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
Data: map[string]any{
|
||||
"key1": "value1",
|
||||
"key2": "value2",
|
||||
},
|
||||
Metadata: map[string]any{
|
||||
"key1": "value1",
|
||||
"key2": "value2",
|
||||
},
|
||||
}
|
||||
|
||||
var account2 = Account{
|
||||
ID: uuid.NewString(),
|
||||
Namespace: "test",
|
||||
Authentication: AccountAuth{
|
||||
Local: &LocalAuth{
|
||||
Username: Ptr("test2"),
|
||||
Password: "hashedpassword",
|
||||
},
|
||||
},
|
||||
Data: map[string]any{
|
||||
"key1": "value3",
|
||||
"key2": "value4",
|
||||
},
|
||||
Metadata: map[string]any{
|
||||
"key1": "value5",
|
||||
"key2": "value6",
|
||||
},
|
||||
}
|
||||
|
||||
var account3 = Account{
|
||||
ID: uuid.NewString(),
|
||||
Namespace: "other_namespace",
|
||||
Authentication: AccountAuth{
|
||||
Local: nil,
|
||||
},
|
||||
Data: map[string]any{
|
||||
"key1": "value3",
|
||||
"key2": "value4",
|
||||
},
|
||||
Metadata: map[string]any{
|
||||
"key1": "value5",
|
||||
"key2": "value6",
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user