mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-18 11:00:06 +02:00
refactor jwtValidator and geo db to interfaces + first component test for setup-keys
This commit is contained in:
@@ -14,7 +14,7 @@ func generateAndStoreEvents(t *testing.T, manager *DefaultAccountManager, typ ac
|
||||
accountID string, count int) {
|
||||
t.Helper()
|
||||
for i := 0; i < count; i++ {
|
||||
_, err := manager.eventStore.Save(context.Background(), &activity.Event{
|
||||
_, err := manager.EventStore.Save(context.Background(), &activity.Event{
|
||||
Timestamp: time.Now().UTC(),
|
||||
Activity: typ,
|
||||
InitiatorID: initiatorID,
|
||||
@@ -41,7 +41,7 @@ func TestDefaultAccountManager_GetEvents(t *testing.T) {
|
||||
return
|
||||
}
|
||||
assert.Len(t, events, 0)
|
||||
_ = manager.eventStore.Close(context.Background()) //nolint
|
||||
_ = manager.EventStore.Close(context.Background()) //nolint
|
||||
})
|
||||
|
||||
t.Run("get events", func(t *testing.T) {
|
||||
@@ -52,7 +52,7 @@ func TestDefaultAccountManager_GetEvents(t *testing.T) {
|
||||
}
|
||||
|
||||
assert.Len(t, events, 10)
|
||||
_ = manager.eventStore.Close(context.Background()) //nolint
|
||||
_ = manager.EventStore.Close(context.Background()) //nolint
|
||||
})
|
||||
|
||||
t.Run("get events without duplicates", func(t *testing.T) {
|
||||
@@ -62,6 +62,6 @@ func TestDefaultAccountManager_GetEvents(t *testing.T) {
|
||||
return
|
||||
}
|
||||
assert.Len(t, events, 1)
|
||||
_ = manager.eventStore.Close(context.Background()) //nolint
|
||||
_ = manager.EventStore.Close(context.Background()) //nolint
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user