Files
netbird/client/internal/flowstore/store_test.go
T
2025-02-26 12:06:06 +01:00

33 lines
611 B
Go

package flowstore_test
import (
"context"
"testing"
"github.com/google/uuid"
"github.com/netbirdio/netbird/client/internal/flowstore"
)
func TestStore(t *testing.T) {
store := flowstore.New(context.Background())
t.Cleanup(func() {
store.Close()
})
event := flowstore.EventFields{
FlowID: uuid.New(),
Type: flowstore.TypeStart,
Direction: flowstore.Ingress,
Protocol: 6,
}
store.StoreEvent(event)
allEvents := store.GetEvents()
for _, e := range allEvents {
if e.EventFields.FlowID != event.FlowID {
t.Errorf("expected event ID %s, got %s", event.FlowID, e.ID)
}
}
}