package bootstrapimpl

import "testing"

func TestSystemTablesIncludeSecurityObjectKeyPrefixes(t *testing.T) {
	defs := GetSystemTableDefinitions()
	want := map[string]string{
		"Group":         "00G",
		"PermissionSet": "0PS",
	}

	for tableName, keyPrefix := range want {
		found := false
		for _, def := range defs {
			if def.TableName != tableName {
				continue
			}
			found = true
			if def.KeyPrefix != keyPrefix {
				t.Fatalf("%s keyPrefix = %q, want %q", tableName, def.KeyPrefix, keyPrefix)
			}
			break
		}
		if !found {
			t.Fatalf("%s missing from system_tables.json", tableName)
		}
	}
}
