Files
logs/internal/models/blueprint_fields_test.go
2026-06-26 12:51:50 +08:00

25 lines
696 B
Go

package models
import (
"reflect"
"testing"
)
func TestTrapDictionaryEntryHasBlueprintFields(t *testing.T) {
typ := reflect.TypeOf(TrapDictionaryEntry{})
for _, name := range []string{"Vendor", "OID", "Name", "SeverityMappingJSON", "ParseExpression"} {
if _, ok := typ.FieldByName(name); !ok {
t.Fatalf("TrapDictionaryEntry missing blueprint field %s", name)
}
}
}
func TestSyslogRuleHasBlueprintFields(t *testing.T) {
typ := reflect.TypeOf(SyslogRule{})
for _, name := range []string{"SourceMatch", "MessageRegex", "SeverityMappingJSON", "ResourceUIDExtractRegex"} {
if _, ok := typ.FieldByName(name); !ok {
t.Fatalf("SyslogRule missing blueprint field %s", name)
}
}
}