layer1: add namespace manager bridge step 12
This commit is contained in:
@@ -157,4 +157,25 @@ func TestNamespaceManagerBootstrap(t *testing.T) {
|
||||
if record.Source != NamespaceSourceBackfill {
|
||||
t.Fatalf("expected bootstrap source backfill, got %s", record.Source)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewBootstrappedNamespaceManager(t *testing.T) {
|
||||
resolver := &NamespaceResolver{
|
||||
FissionResourceNS: map[string]string{
|
||||
"tenant-b": "tenant-b",
|
||||
"tenant-a": "tenant-a",
|
||||
},
|
||||
}
|
||||
|
||||
manager := NewBootstrappedNamespaceManager(resolver, NamespaceSourceEnv, time.Now().UTC())
|
||||
if !reflect.DeepEqual([]string{"tenant-a", "tenant-b"}, manager.Snapshot()) {
|
||||
t.Fatalf("expected bootstrapped manager snapshot from resolver")
|
||||
}
|
||||
record, ok := manager.Get("tenant-a")
|
||||
if !ok {
|
||||
t.Fatalf("expected tenant-a in bootstrapped manager")
|
||||
}
|
||||
if record.Source != NamespaceSourceEnv {
|
||||
t.Fatalf("expected env source, got %s", record.Source)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user